oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.01k stars 2.75k forks source link

Trying to run Nuxt 3 dev server using `bun --bun run dev` #13187

Open nathanchase opened 2 months ago

nathanchase commented 2 months ago

How can we reproduce the crash?

bun --bun run dev
$ nuxt dev
Nuxt 3.12.4 with Nitro 2.9.7                                                                               12:46:01 AM
                                                                                                           12:46:05 AM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

                                                                                                           12:46:07 AM
                                                                                                           12:46:07 AM
                                                                                                           12:46:07 AM
ℹ Running with compatibility version 4                                                                    12:46:08 AM
✔ Nitro config hot reloaded!                                                                              12:46:08 AM
ℹ Re-optimizing dependencies because lockfile has changed                                                 12:46:10 AM
✔ Vite client built in 142ms                                                                              12:46:10 AM
✔ Vite server built in 498ms                                                                              12:46:10 AM
✔ Nuxt Nitro server built in 1615 ms                                                                nitro 12:46:12 AM
ℹ Vite client warmed up in 2ms                                                                            12:46:12 AM
ℹ Vite server warmed up in 33ms                                                                           12:46:12 AM
============================================================
Bun v1.1.20 (ae194892) Linux x64
WSL Kernel v5.15.153 | glibc v2.39
CPU: sse42 popcnt avx avx2
Features: jsc Bun.stdin(4) Bun.stdout dotenv(2) http_server spawn(6) transpiler_cache(58) tsconfig_paths(38) tsconfig(79)
Builtins: "bun:jsc" "bun:main" "detect-libc" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:perf_hooks" "node:process" "node:querystring" "node:readline" "node:stream" "node:stream/promises" "node:string_decoder" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:vm" "node:zlib" "node:worker_threads" "ws" "node:v8" "node:inspector" "node:http2"
Elapsed: 8986ms | User: 9243ms | Sys: 2612ms
RSS: 1.91GB | Peak: 0.99GB | Commit: 1.91GB | Faults: 701

panic: Segmentation fault at address 0x1A
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.20 (ae19489) on linux x86_64 [RunAsNodeCommand]

Segmentation fault at address 0x0000001A

github-actions[bot] commented 2 months ago

@nathanchase, the latest version of Bun is v1.1.21, but this crash was reported on Bun v1.1.20.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade
nathanchase commented 2 months ago

@nathanchase, the latest version of Bun is v1.1.21, but this crash was reported on Bun v1.1.20.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade

Yes, although the crash is different and looks to be caused by the sharp module:

 ERROR  [worker reload] [worker init] 32 |     if (loadedModule) {                                          1:00:26 PM
33 |       const [, loadedPackage] = loadedModule.match(/node_modules[\\/]([^\\/]+)[\\/]/);
34 |       help.push(- Ensure the version of sharp aligns with the ${loadedPackage} package: "npm ls sharp");
35 |     }
36 |   }
37 |   throw new Error(help.join('\n'));
             ^
error:
Something went wrong installing the "sharp" module

symbol 'napi_register_module_v1' not found in native module. Is this a Node API (napi) module?

  Possible solutions:
  - Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
  - Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
  - Consult the installation documentation: https://sharp.pixelplumbing.com/install
  at node_modules/sharp/lib/sharp.js:37:9
  at node_modules/sharp/lib/constructor.js:11:1
  at node_modules/sharp/lib/index.js:6:7

  at #onError (node:worker_threads:192:11)