Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun development server crashes when importing HeroUI #17863

Closed
leetcow opened this issue Mar 3, 2025 · 3 comments · Fixed by #17954
Closed

Bun development server crashes when importing HeroUI #17863

leetcow opened this issue Mar 3, 2025 · 3 comments · Fixed by #17954
Labels
bake:dev hot-reloading dev server for client+server applications bug Something isn't working bundler Something to do with the bundler

Comments

@leetcow
Copy link

leetcow commented Mar 3, 2025

What version of Bun is running?

Bun v1.2.4 (fd9a5ea) macOS Silicon

What platform is your computer?

macOS v15.3 Silicon

What steps can reproduce the bug?

bun src/index.html crashes when I include HeroUI's <HeroUIProvider> in my index.tsx's returned html.

➜ http://localhost:3000/

Press h + Enter to show shortcuts
============================================================
Bun v1.2.4 (fd9a5ea6) macOS Silicon
macOS v15.3
Args: "bun" "src/index.html"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) bunfig http_server jsc dev_server tsconfig process_dlopen 
Builtins: "bun:jsc" "node:assert" "node:buffer" "node:constants" "node:crypto" "node:fs" "node:fs/promises" "node:module" "node:os" "node:path" "node:perf_hooks" "node:process" "node:stream" "node:string_decoder" "node:tty" "node:url" "node:util" "node:util/types" "node:vm" "node:v8" 
Elapsed: 1388ms | User: 693ms | Sys: 528ms
RSS: 0.33GB | Peak: 0.33GB | Commit: 1.07GB | Faults: 106

panic: Unexpected tag in printStmt: .s_lazy_export
Crashed while printing /Users/marcos/Documents/GitHub/leetcow/bombtimer.dev/node_modules/@heroui/shared-icons/dist/chunk-V2PVPQWW.mjs
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.2.4/Ma1fd9a5eakIukg0Bukxt1Cmk3uJ+mnwJuwimK+7lwBm929H__A0eNoLzUutKEhNLklNUShJTFfIzFMoKMrMKwkuyS2xUtArjs9JrKqMT60oyC8qAQBkpRB5

oh no: multiple threads are crashing
panic: Unexpected tag in printStmt: .s_lazy_export
Crashed while printing /Users/marcos/Documents/GitHub/leetcow/bombtimer.dev/node_modules/@heroui/shared-icons/dist/chunk-GQGYXTXM.mjs
 https://bun.report/1.2.4/Ma1fd9a5eakIukg0Bukxt1Cmk3uJ+mnwJuwimK+7lwBm929H__A0eNoLzUutKEhNLklNUShJTFfIzFMoKMrMKwkuyS2xUtArjs9JrKqMT60oyC8qAQBkpRB5

oh no: multiple threads are crashing
panic: Unexpected tag in printStmt: .s_lazy_export
Crashed while printing /Users/marcos/Documents/GitHub/leetcow/bombtimer.dev/node_modules/@heroui/theme/dist/chunk-WQEDQHKX.mjs
 [1]    76707 trace trap  bun src/index.html

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

Stack trace:

Bun v1.2.4 (fd9a5ea) on macos aarch64 [AutoCommand]

panic: Unexpected tag in printStmt: .s_lazy_export

  • js_printer.NewPrinter
  • js_printer.NewPrinter
  • bundler.bundle_v2.LinkerContext.printCodeForFileInChunkJS
  • bundler.bundle_v2.LinkerContext.generateCompileResultForJSChunk
  • Thread.PosixThreadImpl.spawn__anon_350893.Instance.entryFn

Features: tsconfig, tsconfig_paths, process_dlopen, Bun.stderr, Bun.stdout, bunfig, dotenv, http_server, jsc, dev_server

Sentry Issue: BUN-DAV

@leetcow leetcow added bug Something isn't working needs triage labels Mar 3, 2025
@RiskyMH RiskyMH added bundler Something to do with the bundler bake:dev hot-reloading dev server for client+server applications and removed needs triage labels Mar 3, 2025
@iamleniac
Copy link

I have the same problem with chakra-ui@v2 on Linux:

============================================================
Bun v1.2.4 (fd9a5ea6) Linux x64
Linux Kernel v6.12.10 | glibc v2.39
CPU: sse42 popcnt avx avx2
Args: "bun" "run" "--watch" "bun.serve.ts"
Features: http_server jsc dev_server tsconfig(9) tsconfig_paths(4)
Builtins: "bun:main"
Elapsed: 5104ms | User: 2434ms | Sys: 1107ms
RSS: 0.98GB | Peak: 0.38GB | Commit: 0.98GB | Faults: 0

panic: Unexpected tag in printStmt: .s_lazy_export
Crashed while printing /home/leniac/workspace/filia/fsp-x/node_modules/@chakra-ui/theme-utils/
dist/chunk-SUJGGKVT.mjs
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.2.4/lr1fd9a5eaMggg0Bwxry3CswnqiDi07riDgo6kjDyxqw4Con9ygDmqlnB2juqCA0eNoL
zUutKEhNLklNUShJTFfIzFMoKMrMKwkuyS2xUtArjs9JrKqMT60oyC8qAQBkpRB5

--- Bun is auto-restarting due to crash [time: 1741184327832] ---

@leetcow
Copy link
Author

leetcow commented Mar 5, 2025

Jarred pointed out on discord that passing development: { hmr: false } as an option in bun.serve() fixes the issue as it is HMR related.

This disables hot module reloading, but should be a temporary fix until the issue is addressed.

Can confirm this fixes the issue in both latest stable and canary releases.

@paperclover
Copy link
Member

paperclover commented Mar 7, 2025

in #17954 the error is now this, which is honestly bad enough to block the PR entirely from merging

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bake:dev hot-reloading dev server for client+server applications bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants