Skip to content

fix: Bun build failes in docker with "Export 'toNodeHandler' not found" when using Nuxt Devtools alpha.9 and @nuxt/image and special tsconfig #1050

Open

Description

@DragonFire7

🐛 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

  1. Clone the repository.
  2. Run docker build --no-cache .
  3. The build crashes at the bun run build step.

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/image and @nuxt/devtools (with one of the mentioned versions) are in the devDependencies. The build and postinstall scripts 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 postinstall script, the types don't seem to be generated while building, thus the tsconfig.json doesn'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-alpine to oven/bun:1-slim or oven/bun:1 didn'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

Activity

  1. coderabbitai commented on Aug 1, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #952 - feat(v4)!: always use Vite DevTools, remove floating panel [closed]
    #1005 - chore(deps): update dependencies [closed]
    #1031 - feat(devtools): select client Vite context deterministically, add Nuxt dock group [merged]
    #1041 - feat(devtools)!: make embedded dock the only client mode [merged]
    #1048 - deps: upgrade to nuxt-nightly (5x) and vite ^8.1 [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    p3-minor-bugSmall bug or edge case, low impact
    DevTools v4Reported against Nuxt DevTools v4 (main, default in Nuxt 5)
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevTools v4Reported against Nuxt DevTools v4 (main, default in Nuxt 5)bugSomething isn't workingp3-minor-bugSmall bug or edge case, low impact

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions