oven-sh / bun

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

SegmentationFault on simple Next server #1361

Closed peterbe closed 8 months ago

peterbe commented 1 year ago

What version of Bun is running?

0.2.1

What platform is your computer?

Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64 i386

What steps can reproduce the bug?

bun create next my-next-app
cd my-next-app
bun dev

Initially http://localhost:3000 is working fine. Now simple benchmark:

hey -n 1000 -c 10 http://localhost:3000

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior?

That it serves all 1,000 requests in the benchmark by hey.

What do you see instead?

...
[8.40ms] / - 3 transpiled, 6 imports
[8.52ms] / - 3 transpiled, 6 imports
[8.58ms] / - 3 transpiled, 6 imports
[8.68ms] / - 3 transpiled, 6 imports
[8.80ms] / - 3 transpiled, 6 imports
[8.88ms] / - 3 transpiled, 6 imports
[8.90ms] / - 3 transpiled, 6 imports
[8.94ms] / - 3 transpiled, 6 imports
[8.98ms] / - 3 transpiled, 6 imports
[8.74ms] / - 3 transpiled, 6 imports
[8.64ms] / - 3 transpiled, 6 imports
[8.56ms] / - 3 transpiled, 6 imports
[10.25ms] / - 3 transpiled, 6 imports
[10.59ms] / - 3 transpiled, 6 imports

SegmentationFault at 0x0000000000000000

----- bun meta -----
Bun v0.2.1 (1835e4b9) macOS x64 21.6.0
DevCommand: fast_refresh hot_module_reloading tsconfig bun_bun filesystem_router framework bunjs public_folder bunfig
Elapsed: 5027ms | User: 1031ms | Sys: 200ms
RSS: 103.91MB | Peak: 103.91MB | Commit: 79.72MB | Faults: 0
----- bun meta -----

Ask for #help in https://bun.sh/discord or go to https://bun.sh/issues

Additional information

This is the package.json that the bun create next created:

{
  "name": "my-next-app",
  "version": "0.0.117",
  "dependencies": {
    "next": "12.2.3",
    "react": "^18",
    "react-dom": "^18",
    "react-is": "^18"
  },
  "devDependencies": {
    "@types/react": "^18",
    "bun-framework-next": "^12.2",
    "typescript": "latest",
    "react-refresh": "0.10.0"
  },
  "module": "index.js"
}
Electroid commented 8 months ago

bun dev was changed in Bun v1.0, it will now run the "dev" script in your package.json. Because of that, this issue is no longer applicable.