fix: Bun build failes in docker with "Export 'toNodeHandler' not found" when using Nuxt Devtools alpha.9 and @nuxt/image and special tsconfig
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- bun, docker, nuxtjs, typescript
- Lĩnh vực
- build-system, devtools
Hướng nghiên cứu
Clone reproduction NuxtDevToolsMinimal được liên kết và chạy docker build --no-cache . để xác nhận lỗi tại bun run build. So sánh các phiên bản @nuxt/devtools được liệt kê và kiểm tra package.json, nuxt.config.ts, tsconfig.json cũ, Dockerfile và thiết lập postinstall. Được xem là hoàn tất khi Docker build hoàn thành mà không có lỗi export toNodeHandler.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐛 The bug
Bug/Error:
I found a very specific interaction bug in @nuxt/devtools Version 4.0.0-alpha.8 and 4.0.0-alpha.9 (it doesn't happen in 4.0.0-alpha.7). This is quite an edge case.
The docker build fails at bun run build with the error:
ERROR Export named 'toNodeHandler' not found in module '/app/node_modules/h3/dist/index.cjs'.
at <parse> (:0)
at processTicksAndRejections (native:7:39)
error: script "build" exited with code 1
🛠️ To reproduce
https://github.com/DragonFire7/NuxtDevToolsMinimal
🌈 Expected behavior
Minimal reproduction:
I built a minimal reproduction here: https://github.com/DragonFire7/NuxtDevToolsMinimal
- Clone the repository.
- Run
docker build --no-cache . - The build crashes at the
bun run buildstep.
Expected bahavior:
No errors when running the docker build
ℹ️ Additional context
Description/Details:
The bug happens when building with Docker and Bun. It does not happen locally on my Windows machine.
It only occurs when all of the following criteria are met:
package.json:@nuxt/imageand@nuxt/devtools(with one of the mentioned versions) are in thedevDependencies. Thebuildandpostinstallscripts must also be present.nuxt.config.ts: A basic config utilizing the Nitro preset for Bun.tsconfig.json: This is why I call it an edge case. It only happens when the project came from Nuxt 3 and still uses the legacy Nuxt 3 tsconfig format. When updating my project's config to the new Nuxt 4 tsconfig format, everything works perfectly again.Dockerfile: The Dockerfile is pretty standard and only shows the building stage, since the error already occurs there.
What I found through trial and error:
- Without the
postinstallscript, the types don't seem to be generated while building, thus thetsconfig.jsondoesn't have any effect and the build succeeds. - Without
@nuxt/image, no error occurs. The issue seems to be introduced by an interaction between the two modules during the build process. - Switching the base image from
oven/bun:1-alpinetooven/bun:1-slimoroven/bun:1didn't have any effect.
Since this is very much an edge case tied to an outdated tsconfig.json, it is low priority in my opinion. However, I wanted to report it in case it helps others searching for a solution
- Ngôn ngữ chính
- TypeScript
- Star
- 3.3k
- Fork
- 214
- Merge trung bình
- 19 giờ 45 phút
- Pull request đã merge (30 ngày)
- 12
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 nuxt/devtools
-
fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units) Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
feat: Nuxt devtools for AI Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
bug needs reproduction
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Tất cả issue của nuxt/devtools
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100