fix: Bun build failes in docker with "Export 'toNodeHandler' not found" when using Nuxt Devtools alpha.9 and @nuxt/image and special tsconfig
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- bun, docker, nuxtjs, typescript
- Ambito
- build-system, devtools
Direzione di ricerca
Clona la riproduzione NuxtDevToolsMinimal collegata ed esegui docker build --no-cache . per confermare il fallimento in bun run build. Confronta le versioni di @nuxt/devtools elencate e ispeziona package.json, nuxt.config.ts, il tsconfig.json legacy, Dockerfile e la configurazione di postinstall. Il lavoro è completato quando la build Docker termina senza l’errore di esportazione di toNodeHandler.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 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
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 214
- Merge medio
- 19h 45m
- PR unite (30g)
- 12
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nuxt/devtools
-
fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units) Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
feat: Nuxt devtools for AI Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
bug needs reproduction
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Tutte le issue di nuxt/devtools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mksglu/context-mode#1200 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
AOSSIE-Org/DebateAI#582 · 2 commenti ·