bun icon indicating copy to clipboard operation
bun copied to clipboard

No source files in debugger with `--inspect`

Open cbetori opened this issue 1 year ago • 8 comments

What version of Bun is running?

1.0.0

What platform is your computer?

WSL Debian

What steps can reproduce the bug?

Running bun run --inspect index.ts runs the file and creates a debugger at debug.bun.sh . But no files show up in the debugger.

I tested the same code on Ubuntu to everything worked as expected.

What is the expected behavior?

Expect debugger to show files being debugged

What do you see instead?

No files are found

Additional information

No response

cbetori avatar Sep 09 '23 18:09 cbetori

I have the same experience.

Started with bun run --inspect index.ts in the Linux shell, and gets startup logs. Goes to the link specified and meets no files. The breakpoints were also not stopping the code execution. Trying to attach with VSCode gave me

Debugger detached.
Unexpected server response: 404
2
Debugger detached.
Unexpected server response: 404
2
Debugger detached.
Unexpected server response: 404
Debugger detached.

PatrickMatthiesen avatar Sep 11 '23 21:09 PatrickMatthiesen

For me, it seems the underlying issue is the websocket connection is failing. While Windows/WSL normally has bridging so localhost/127.0.0.1 "just work" across environments, in this case it seems it might need to be the actual WSL IP address?

However, upon changing that manually (e.g. https://debug.bun.sh/#172.28.21.84:6499/) I then get a WebKit Inspector error, which is a result of "Mixed Content: The page at 'https://debug.bun.sh/#172.28.21.84:6499/h5asdy9zdw' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://172.28.21.84:6499/h5asdy9zdw'.

infrahead avatar Sep 15 '23 06:09 infrahead

same issue(

romanlex avatar Oct 30 '23 22:10 romanlex

I think the title should be updated to WSL issue somewhere. I feel like @infrahead is right on the money. Even replacing localhost with 127.0.0.1 seems to always work

JoshuaHintze avatar Dec 07 '23 13:12 JoshuaHintze

I'm seeing the same issue on macOS 14.1

iwaffles avatar Dec 17 '23 15:12 iwaffles

This might be a dumb suggestion, but for me, disabling my browser's ad blocker fixed the issue. I'm running Linux Mint with Brave.

dbudzins avatar Apr 28 '24 14:04 dbudzins

This might be a dumb suggestion, but for me, disabling my browser's ad blocker fixed the issue. I'm running Linux Mint with Brave.

I also ran into this issue. I added the following line to my filters in ublock Origin: @@||localhost:6499^$websocket,domain=debug.bun.sh

Screenshot_2024-04-30_21-21-06

punowo avatar Apr 30 '24 19:04 punowo

same, safari macos using bun server. sources not appearing. disabled ad blockers, private browser, executing script directly, through the workspace, with --inspect --inspect-brk, with and without debugger statements in the source code. sad

twny avatar May 08 '24 02:05 twny