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

Ouverte
#1,201 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

@OKAN-SOFTWARE y travaille déjà.

Depuis le 30/10/2026.

  • #1204 par @OKAN-SOFTWARE — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
65/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
javascript, node.js, vite
Domaine
tooling

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
JavaScript
Étoiles
70
Forks
79
Merge moyen
1 j 21 h
PR mergées (30 j)
39

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de nodejs/doc-kit

Toutes les issues de nodejs/doc-kit

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.