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

Offen
#1,201 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@OKAN-SOFTWARE arbeitet bereits daran.

Seit 30.10.2026.

  • #1204 von @OKAN-SOFTWARE — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
javascript, node.js, vite
Bereich
tooling

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
JavaScript
Sterne
70
Forks
79
Ø Merge
1 T. 21 Std.
Gemergte PRs (30 T.)
39

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/doc-kit

Alle Issues in nodejs/doc-kit

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.