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

Aperta
#1,201 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@OKAN-SOFTWARE ci sta già lavorando.

Dal 30/10/2026.

  • #1204 di @OKAN-SOFTWARE — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, node.js, vite
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
70
Fork
79
Merge medio
1g 21h
PR unite (30g)
39

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nodejs/doc-kit

Tutte le issue di nodejs/doc-kit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.