-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to start debugger. Program could not be started. #13071
Comments
I got the similar logs in 2024-08-05 00:37:56.722 [error] Error: listen EACCES: permission denied C:\Users\LIUD~1.H\AppData\Local\Temp\vd7f7p7ez1r.sock
at Server.setupListenHandle [as _listen2] (node:net:1881:21)
at listenInCluster (node:net:1946:12)
at Server.listen (node:net:2061:5)
at new UnixSignal (c:\Users\Liu.D.H\.vscode\extensions\bun-debug-adapter-protocol\src\debugger\signal.ts:40:18)
at DebugAdapter.#launch (c:\Users\Liu.D.H\.vscode\extensions\bun-debug-adapter-protocol\src\debugger\adapter.ts:493:20)
at DebugAdapter.launch (c:\Users\Liu.D.H\.vscode\extensions\bun-debug-adapter-protocol\src\debugger\adapter.ts:439:18)
at DebugAdapter.Adapter.request (c:\Users\Liu.D.H\.vscode\extensions\bun-debug-adapter-protocol\src\debugger\adapter.ts:350:21)
at DebugAdapter.emit (c:\Users\Liu.D.H\.vscode\extensions\bun-debug-adapter-protocol\src\debugger\adapter.ts:297:26)
at FileDebugSession.handleMessage (c:\Users\Liu.D.H\.vscode\extensions\oven.bun-vscode-0.0.12\src\features\debug.ts:195:20)
at D.sendMessage (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:163:706)
at s.$sendDAMessage (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:162:12040)
at E.S (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5980)
at E.Q (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5746)
at E.M (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:4778)
at E.L (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:3605)
at i.value (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:2297)
at n.B (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:737)
at n.fire (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:954)
at s.fire (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:14453)
at i.value (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:8655)
at n.B (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:737)
at n.fire (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:954)
at s.fire (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:14453)
at MessagePortMain.<anonymous> (c:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6781)
at MessagePortMain.emit (node:events:519:28)
at MessagePortMain.emit (node:domain:488:12)
at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285) |
I have also noticed some error logs in It's really strange, I only got
And the following error log in
From the error log and the code of vscode extension, it seems the following code doesn't working on windows. bun/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts Lines 492 to 493 in 680f842
bun/src/js/internal/debugger.ts Lines 55 to 56 in 680f842
I also evaluated And If I changed |
Well, after some debugging, I found the problem is related to bun/src/js/internal/debugger.ts Lines 266 to 269 in 680f842
bun/src/js/internal/debugger.ts Lines 73 to 95 in 680f842
For the sample code. import { pathToFileURL } from 'url';
Bun.serve({
unix: 'D:/echo.sock', // works, pathToFileURL('D:/echo.sock').pathname or '/D:/echo.sock' failed with EUNKNOWN: An unknown error occurred
fetch(req) {
return new Response(`404!`);
},
}); So the fix maybe update |
raised a PR, but need to add in tests |
getting this on mac aswell... |
What version of Bun is running?
1.1.21
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
Env Setup
Visual Studio Code ( Version: 1.92.0 )
Bun for Visual Studio Code Extension, Oven ( Version: v0.0.12, extension Id oven.bun-vscode)
Code found in
https://github.com/mkdirJava/BunIssueReplication
Steps
Clone the above repo
Open in Vscode
Whilst main panel has index.ts open run Vscode debug "Debug File"
Open "Debug Console" in the bottom panel ( might have to open a terminal and find the tab )
"Debug Console" reports
"Failed to start debugger.
Program must be a JavaScript or TypeScript file."
Looked further into the issue via logs found in
C:\Users<user>\AppData\Roaming\Code\logs\20240804T094251\window1\exthost\exthost.log
Looks like the extension is trying to open a reserved port
2024-08-04 09:46:15.465 [error] Error: listen EACCES: permission denied C:\Users<user>\AppData\Local\Temp\0vyubmzqvx4g.sock
at Server.setupListenHandle [as _listen2] (node:net:1881:21)
What is the expected behavior?
Given I have the repo cloned
https://github.com/mkdirJava/BunIssueReplication
And the Bun Extension installed
When I have the index.ts file open
And I have a break point set
And I click debug in Vscode
Then I should hit the debug line in debug mode
What do you see instead?
Failed to start debugger.
Program must be a JavaScript or TypeScript file.
Additional information
Looked further into the issue via logs found in
C:\Users<user>\AppData\Roaming\Code\logs\20240804T094251\window1\exthost\exthost.log
Looks like the extension is trying to open a reserved port
2024-08-04 09:46:15.465 [error] Error: listen EACCES: permission denied C:\Users<user>\AppData\Local\Temp\0vyubmzqvx4g.sock
The text was updated successfully, but these errors were encountered: