html: a custom bundler fails with DataCloneError unless threads is 1

未關閉
#1,201 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

@OKAN-SOFTWARE 已經在處理了。

開始於 2026年10月30日。

  • #1204 來自 @OKAN-SOFTWARE —— 未關閉

評估

難度
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 內容生成。

描述

good first issue help wanted Web Generator

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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodejs/doc-kit 的其他 Issue

查看 nodejs/doc-kit 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。