oven-sh / bun

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

Breakpoints are being hit at unexpected locations when using Bun for debugging #15131

Open k3341095 opened 1 week ago

k3341095 commented 1 week ago

What version of Bun is running?

1.1.34

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

When setting breakpoints on every line and starting a debug session, breakpoints are triggered on the second line instead of the first. The first line should be where the breakpoint is hit. Additionally, when pressing F10 (Step Over), the debugger should move to the next line, but it sometimes behaves like "Run" and continues execution without stepping to the next line.

When working with ElysiaJS, breakpoints sometimes hit at unexpected locations, and there are instances where breakpoints are not triggered at all.

What is the expected behavior?

The breakpoint should be hit exactly at the first line (or the line where the breakpoint is set). When pressing F10 (Step Over), the debugger should execute one line at a time, moving to the next line as expected.

What do you see instead?

No response

Additional information

This issue occurs on Linux, macOS, in both VSCode and Cursor. However, the same issue does not occur with Node.js or Deno.

k3341095 commented 1 week ago

bun debug... Image

node debug Image

k3341095 commented 6 days ago

Image

webstorm debug same same

k3341095 commented 5 days ago

Image When pressing F10, it should move to the next line, but... Image It just runs like pressing F5 instead.