Open Braayy opened 1 year ago
Confirming that debugger
statements are ignored.
Please fix this :pray:
Also encountering this behavior in very simple graph walk file logic, should have multiple opportunities to break on the keyword
I could work around this by using
bun run --inspect-brk <file>
which adds and breaks at the first line of the file.
From here, I just open the inspect URL in a browser and hit Continue script execution (⌃Y or ⌃\)
and then bun correctly breaks at the debugger I added to my code.
Is there any other way to pause the Bun debugger via code? Any Bun-specific API or something?
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Linux 6.1.52-1-lts x86_64 unknown
What steps can reproduce the bug?
I've search about debugging with bun, and i found out about the --inspect flag.
So i've got testing this feature with a simple script, but it didn't work out.
Running
bun --inspect index.ts
simply logs "Hello World!" and nothing else happens. The debugger statement is ignored.So i thought that i needed an infinite loop at the end for it to work.
The code is executed normally and hangs at the end, but now a web debugger link appears on the console as well.
So i click on the link to access the web debugger, but it is empty. No breakpoint hit neither source code for me to inspect.
So then i tested if a get something if a do a infinite loop using setInterval.
And now it works correctly, even if i put the debugger statement.
What is the expected behavior?
I think the expected behavior is that if there is a debugger statement, even if the program doesn't hang with a infinite loop, a breakpoint hit should make the program stop, a web debugger link should appear on the console and the web debugger should be populated with the running script.
What do you see instead?
No response
Additional information
No response