html: a custom bundler fails with DataCloneError unless threads is 1
維護者通常 2 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 65/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js, vite
- 領域
- tooling
研究方向
Start with threading/parallel.mjs and compare how it sends configuration[generatorName] to workers with the specifier-based approach from #1157. Reproduce the reported DataCloneError using the custom Vite bundler configuration from docs/customization.md with the default thread count, then check that the configuration works with multiple threads.
由索引模型根據 Issue 內容生成。
描述
Setting html.bundler to an adapter, the Vite one included, fails as soon as there's more than one thread. This is the config from docs/customization.md, minus the Vite options:
import { createViteBundler } from '@doc-kit/generator-react/html/bundlers/vite';
export default {
html: { bundler: createViteBundler() },
};
DataCloneError: context => buildServer({ ...context, vite: options }) could not be cloned.
threading/parallel.mjs sends each worker configuration[generatorName] as is, and functions can't be cloned. Since threads defaults to the CPU count, the documented example fails out of the box. It works with -p 1, and without bundler, since the generator creates the default adapter itself.
Markdown plugins had the same problem and #1157 fixed it by passing specifiers that workers import, so the bundler could probably work the same way.
- 主要語言
- JavaScript
- 星號
- 70
- 分支
- 79
- 平均合併
- 1 天 21 小時
- 30 天內合併 PR
- 39
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nodejs/doc-kit 的其他 Issue
-
addon-verify: re-indents the test.js it generates可能已有人在做 @helmipradita 今天認領。 未關閉good first issue help wanted
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 2 天內回覆
-
難度 2/5 半天 新手友好度 68/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 2 天內回覆
-
question / discussion
難度 4/5 1-2 天 新手友好度 38/100
nodejs/doc-kit#1197 · 3 則留言 · 3 個 reaction ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 55/100
nodejs/doc-kit#1194 · 1 則留言 · 1 個 reaction ·
維護者通常 2 天內回覆
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 25 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
libnativeapi/nativeapi#21 ·
-
area: core complexity: easy impact: medium
難度 2/5 1-3 小時 新手友好度 86/100
ueberdosis/tiptap#8668 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆