Skip to content
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

Cannot debug server in lsp-web-extension-sample #645

Closed
Skleni opened this issue May 18, 2022 · 9 comments · Fixed by #950
Closed

Cannot debug server in lsp-web-extension-sample #645

Skleni opened this issue May 18, 2022 · 9 comments · Fixed by #950
Assignees
Milestone

Comments

@Skleni
Copy link

Skleni commented May 18, 2022

I'm able to run the lsp-web-extension-sample and it does what it's supposed to do. I'm not able to debug or even get any log messaged from the LSP server/web worker though.

The readme says:

If you want to debug the server as well use the launch configuration Attach to Server

When I do that, it briefly shows up, but disappears again after a few seconds:

image

Breakpoints aren't bound:
image

Also, there are no log messages. For example the the message running server lsp-web-extension-sample isn't shown in any of the output channels nor in the debug console. What the debug console does show is the following error:

ERR Error: ENOENT: no such file or directory, stat 'c:\Users\daniel.sklenitzka\AppData\Roaming\Code\logs\20220518T075600\exthost19\webWorker\exthost.log':
EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\daniel.sklenitzka\AppData\Roaming\Code\logs\20220518T075600\exthost19\webWorker\exthost.log'
    at r (C:\Users\daniel.sklenitzka\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:28:4147)
    at r.toFileSystemProviderError (C:\Users\daniel.sklenitzka\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:31:42483)
    at r.stat (C:\Users\daniel.sklenitzka\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:31:34668)

I don't know if that's connected to one or both of the problems described above, but I also have no idea why the file isn't there and how I can fix it.

As I said, the language server itself is working correctly (the colors are visualized), I'm just not able to debug it or get any log messages to appear.

Any help is greatly appreciated.

@dbaeumer
Copy link
Member

@connor4312 can you help with how a user can attach the VS Code debugger to a web worker thread.

@Skleni you should be able to debug this using the debugger from the Developer Tools.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jul 15, 2022
@connor4312
Copy link
Member

connor4312 commented Jul 15, 2022

js-debug doesn't attach to other webworkers aside from the webworker extension host right now.

@dbaeumer
Copy link
Member

dbaeumer commented Aug 4, 2022

OK. This seems to be related to how the debugger is working in VS Code.

@dbaeumer dbaeumer closed this as completed Aug 4, 2022
@nornagon
Copy link

nornagon commented Jan 11, 2024

Just coming in here to say I ran into this too. I can't even figure out where console logs from the worker are being printed. This seems worth figuring out and mentioning in the guide. The only way I've figured out to get information out of the server code is to throw an error, which gets reported in the LSP trace logs.

@ejfasting
Copy link

@dbaeumer from testing the example today it looks like this is still an issue. If there is a problem with the debugger in vscode (still?) I suggest updating the readme for this sample.

vscode reports this when trying to attach to the server:
Error: Could not connect to debug target at http://localhost:6009: Could not find any debuggable target

@dbaeumer
Copy link
Member

dbaeumer commented Feb 2, 2024

@aeschli can you please have a look. You wrote the example. I have updated the dependencies and fixed the code, however the Readme instructions are incorrect since this is a Web example and the server needs to be debugged differently (e.g. the package json has only a browser entry).

@aeschli
Copy link
Contributor

aeschli commented Feb 2, 2024

I updated the readme and fixed source maps.

Debugging the server is currently broken / never worked, I opened issue microsoft/vscode#204114

You can debug the server when running in the web browser.

@aeschli aeschli removed the info-needed Issue requires more information from poster label Feb 2, 2024
@aeschli aeschli added this to the February 2024 milestone Feb 2, 2024
@ejfasting
Copy link

very nice! looks like the underlying issue is actually being fixed as well, which is great! :)

//ej

@ejfasting
Copy link

ejfasting commented Mar 4, 2024

@aeschli Looks like this issue now has been resolved. Probably a good idea to update the example again, to also attach to server (and edit readme.md) ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants