`vp dev` with `experimental.bundledDev` fails on startup: Cannot find package 'rolldown'
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, typescript
- Lĩnh vực
- build-system, devtools
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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'
}
- Ngôn ngữ chính
- Rust
- Star
- 6.3k
- Fork
- 283
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 208
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/vite-plus
-
`vp migrate --full` asks to set up pre-commit hooks even when they're already configuredCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởcontribution welcome
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
voidzero-dev/vite-plus#3096 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/vite-plus#2882 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
voidzero-dev/vite-plus#2097 · 10 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
voidzero-dev/vite-plus#3107 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Exec in place instead of spawning and waiting in the CLI's wrapper processesCó thể đã có người làm @fengmk2 đã nhận 1 ngày trước. Đang mở
voidzero-dev/vite-plus#3106 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/vite-plus
Issue tương tự
-
ci: SHA pin 3rd party actionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Nushell launcher failure.Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Zellij doesn't validate hex colors correctly and crashesCó thể đã có người làm @ymcx đã nhận hôm nay. Đang mởsuspected bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
zellij-org/zellij#5732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(api): E_DOSE_ATTR_NONFINITE for a modeled D/R still says the value "never reaches you as a NaN"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100