Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,050 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
bun, docker, nuxtjs, typescript

調査の方向性

リンクされている NuxtDevToolsMinimal の再現環境をクローンし、docker build --no-cache . を実行して bun run build での失敗を確認します。記載されている @nuxt/devtools のバージョンを比較し、package.json、nuxt.config.ts、レガシーな tsconfig.json、Dockerfile、postinstall の設定を調査します。toNodeHandler の export エラーなしで Docker ビルドが完了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
🐛 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

主要言語
TypeScript
スター
3.3k
フォーク
214
平均マージ
19時間 45分
マージ済み PR(30日)
12

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nuxt/devtools のほかの issue

nuxt/devtools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。