`vp dev` with `experimental.bundledDev` fails on startup: Cannot find package 'rolldown'
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- Une demi-journée
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- javascript, node.js, typescript
- Domaine
- build-system, devtools
Piste de recherche
Start with packages/core/build.ts, where bundled development paths are rewritten, and inspect the code around BUNDLED_DEV_CLIENT_ENTRY and ROLLDONE_DEV_RUNTIME_ENTRY. Reproduce with the command_dev_bundled_dev fixture, then verify that vp dev starts, serves /@rolldown/experimental-runtime.mjs, and the client imports the bundled runtime. The relevant existing packaged runtime is dist/rolldown/experimental-runtime.mjs; update the snapshot while ensuring unrelated installed rolldown packages are not used.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
On 1.3.0, vp dev with experimental.bundledDev: true exits on startup with ERR_MODULE_NOT_FOUND for rolldown.
vitejs/vite#23568 changed bundled dev to read the rolldown dev runtime from the installed rolldown package:
const ROLLDOWN_DEV_RUNTIME_ENTRY = "rolldown/experimental/runtime";
function rolldownDevRuntimeEntryPath() {
return fileURLToPath(import.meta.resolve(ROLLDOWN_DEV_RUNTIME_ENTRY));
}
That works in Vite, which depends on rolldown. @voidzero-dev/vite-plus-core bundles rolldown under its own ./rolldown/* exports and has no rolldown dependency, so the bare specifier doesn't resolve. If another package in the project happens to install rolldown, the resolve succeeds but picks up that copy's runtime, which may not match the bundled rolldown.
This is like #2384: a path in the upstream bundled-dev code that the core build doesn't rewrite for the packaged layout.
The runtime is already in the package as ./rolldown/experimental/runtime (dist/rolldown/experimental-runtime.mjs, which has no imports of its own). Resolving that export instead fixes it. We're running this patch locally:
function rolldownDevRuntimeEntryPath() {
- return fileURLToPath(import.meta.resolve(ROLLDOWN_DEV_RUNTIME_ENTRY));
+ return fileURLToPath(import.meta.resolve("@voidzero-dev/vite-plus-core/rolldown/experimental/runtime"));
}
ROLLDOWN_DEV_RUNTIME_ENTRY should keep its upstream value, because getHmrImplementation also uses it to find and rewrite the import in bundledDevClient.mjs. With the patch, vp dev starts, /@rolldown/experimental-runtime.mjs is served, and the client imports it.
A proper fix would probably rewrite the specifier in packages/core/build.ts alongside BUNDLED_DEV_CLIENT_ENTRY. The command_dev_bundled_dev snapshot from #2384 should catch it as long as no other package installs rolldown.
Reproduction
Any project on [email protected] with experimental: { bundledDev: true } in vite.config.ts and no rolldown package installed. The command_dev_bundled_dev fixture from #2384 should show it.
Steps to reproduce
- Create a project with
[email protected]. - Set
experimental: { bundledDev: true }invite.config.ts. - Run
vp dev.
System Info
macOS (Darwin 27.0.0, arm64)
Node 24.22.0
vite-plus 1.3.0 / @voidzero-dev/vite-plus-core 1.3.0
Vitest 5.0.5
Used Package Manager
yarn (4.18.1, node-modules linker)
Logs
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'rolldown' imported from /…/node_modules/vite/dist/vite/node/chunks/node.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:331:9)
at packageResolve (node:internal/modules/esm/resolve:784:25)
at moduleResolve (node:internal/modules/esm/resolve:873:18)
at defaultResolve (node:internal/modules/esm/resolve:1006:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:705:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:725:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:763:56)
at Object.resolve (node:internal/modules/esm/initialize_import_meta:37:25)
at rolldownDevRuntimeEntryPath (file:///…/node_modules/vite/dist/vite/node/chunks/node.js:21927:35)
at file:///…/node_modules/vite/dist/vite/node/chunks/node.js:21924:293 {
code: 'ERR_MODULE_NOT_FOUND'
}
- Langage dominant
- Rust
- Étoiles
- 6.3k
- Forks
- 283
- Merge moyen
- 1 j 14 h
- PR mergées (30 j)
- 208
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de voidzero-dev/vite-plus
-
`vp migrate --full` asks to set up pre-commit hooks even when they're already configuredPeut-être pris @0froq l’a pris il y a 1 jour. Ouvertecontribution welcome
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
voidzero-dev/vite-plus#3096 · 2 commentaires · 3 réactions · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
pending triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
voidzero-dev/vite-plus#2882 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
voidzero-dev/vite-plus#2097 · 10 commentaires · 2 réactions ·
Les mainteneurs répondent en général sous 1 jour
-
pending triage
Difficulté 4/5 3-5 jours Accessibilité débutants 58/100
voidzero-dev/vite-plus#3131 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
voidzero-dev/vite-plus#3129 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de voidzero-dev/vite-plus
Issues similaires
-
good first issue gpu serve
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
Les mainteneurs répondent en général sous 1 jour
-
documentation E-easy good first issue help wanted
Difficulté 1/5 1-3 heures Accessibilité débutants 91/100
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
charles-hood/DiagramCraft#73 ·
-
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
ontologyportal/sigma-rs#200 ·
Les mainteneurs répondent en général sous 1 jour