-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Improve debug self hosting experience #100368
Comments
Also assinging to @weinand since the large self hosting compound debugs everything inlcuding EH debugging |
Related issue filled by @joaomoreno #83994 I will self host on it more in the following days and hopefully can idenity issues that are paper cuts. |
Yes, using the "VS Code" launch config is very frustrating. There are many UX paper cuts like notification spam, questionable debug console selection, disconnect vs stop button etc pp. However, there is also severe trouble where things freeze or crash and that seems to happen 2 out of 3 times and only when a breakpoint is set here but not there or when a console message appears at a bad time or what not. This seems soo random that I cannot file a bug that would meet my personal bug min bar and that's read sad part of this. I have no clue how to help to improve this. |
Following down the issue links, this seems to be the issue on the Electron side for the random crashes electron/electron#21288 |
No. I know about the break-on-async-problem but this is a head to head comparison with devtools and vscode and while I can happily work with the former I cannot with the latter. |
One issue that I repro often is that if the renderer process console.logs a lot while vscode is attached, it will hang. Doesn't happen when only attached with devtools. |
@jrieken please file issues for me when you run into a papercut or problem, even if you run into a issue you can't consistently reproduce. You can also add
This should be better with #99736
Can you expand on these? Either here or a new issue is good.
I think Eric has also seen these. I can only assume this is some problem in Electron. I have not observed the extension host/node/chrome freezing in that way. I'll try to play around and reproduce it locally, a trace: true log would also help if you're able to capture it easily.
I think we fixed this yesterday with: microsoft/vscode-js-debug@154a62d I'll make a console spam extension to try to verify |
Whenever something doesn't work, e.g because there is still a dangling process or so, things go wild. Simulate the worst of it like so:
I know this is a tricky one and my sample is the worst case but when something fails it's enough to say that once. |
That'll be fixed in the next nightly microsoft/vscode-js-debug@c462b53 |
I often get into this rut: reloading the window stays like this forever. Further reloadings behave the same. I am forced to close the window. Once I close the window, I wait for all debug sessions to terminate, which they do. But then when I F5 again I get: At this point I look for running processes:
So I kill 'em: |
The blank window also happens when running |
Since today, my guess is that's electron 8, debugging is totally broken. Run the "VS Code" launch config and be depressed. |
I am seeing the reload issue as well after updating Insiders with ordinary extension host debugging on both the old and new adapters. Definitely seems Electron-related. I tried to reproduce depression but "Launch VS Code" actually works for me fine on master right now. I wonder if @deepak1556 fixed something today? I've seen the dangling |
Nope I haven't addressed anything wrt "Launch VS Code" issue. |
Yea, nevermind, I didn't realize the insiders was frozen -- I checked that I was on the latest but didn't see that it was a pre-Electron 8 build. |
That one we can fix on the vs code side. |
For breakoint locations VS Code trusts extensions and does not update the location. @connor4312 is there a chance we do this on the js-debug extension side? If not possible, I can also look into introducing a general heuristic for all languages based on words. |
The editor model uses the correct word definition in |
Then it feels to me like the proper thing would be to do this on the VS Code side. Especially since I am not aware of a language that would want to place inline breakpoints inside a word. |
The screenshot you showed usually happens when the code in the runtime doesn't match whatever you have running locally. For example, if you change a file but don't reload the extension host. E.g. I can reproduce the problem by putting a blank line in "resolve", which will have the breakpoint on the column where it should normally go in the following line: Does this sound like what might have happened for you? I agree that it's not a good scenario, and we've an issue someone raised about it before. I don't know what the right behavior is, though; the code mismatches so all bets are off, even if we cosmetically shift the breakpoint column. Maybe whenever a file is locally edited we unverify all breakpoints in that file. But that could also become annoying. Open to ideas.
I don't think we should do this. js-debug should be responsible for returning the correct breakpoint columns. If it returns a breakpoint in the middle of the word, that's a problem (usually due to mismatched code, or in 🐛 cases, bad sourcemap resolution). Also, thank you so much for continuing to raise these issues! ❤️ |
Definitely something like that. In my case I did reload but I noticed that I often need to restart webpack (that sample is from an extension) for it to recover. So, not blaming debug for the bad information it retrieves but more for the way it handles those. Generally, I'd say it should be more conservative with those editing while debugging cases |
👍 opened microsoft/vscode-js-debug#538 |
Spinning out the collected issues thus far to make verification less confusing :)
Joh's "window has crashed" -- we're back on E7 for endgame, wondering if E9 will fix this? Will keep an eye out and to see if it happens on E7 and whether I'm able to catch the trace logs red-handed in that scenario. |
Thanks @connor4312 thats super helpful. |
I've stopped trying to use the debug target because:
|
Thanks for the update, will look at this today or tomorrow. |
This is no longer necessary in the self-host case after some refactorings. Works on microsoft/vscode#100368
🏃 I pushed some changes that should improve startup time. We were doing something slow in startup that, in the VS Code case, is no longer needed. Please let me know if that improves things for you. ✔️ I also realized that I only added the "Ensure Prelaunch Dependencies" task to "Launch VS Code", so if you launched the compound task where an update was needed the attachment configs would time out. Fixed that as well...
✔️ Internally js-debug has kind of a legacy feature where tracks the first debug target (in this case, browser page) it sees as the "main target" and stops when it is closed. I think that's what you're hitting here; VS Code might open two windows when it's restoring the state (I assume?) and you're closing the one that's designated as the main target.
✔️ It wasn't my intended purpose when I prompted it, but now that we have a
✔️ Isi fixed this in today's Insiders.
❓ The message indicates that the Electron instance didn't start listening or didn't have good data on localhost:9222. So the debugger didn't connect, and VS Code was waiting indefinitely. Next time you hit that, please try going to http://localhost:9222/json/list; see if it loads and what's there. Also, is seeing that specific error (cc @jrieken) recent since today/Electron 9? Wondering if there's some behavioral change or bug there. |
I resumed using this today with E9 and it seems to work much better than before, actually. |
I still get #105019 from time to time, but it's my only current pain point. |
Please let me know if you try it again and run into more issues! The issue the Rob mentioned and the slippery #103707 are the only two outstanding issues I know of. |
Moving to September since this is on-going work and nothing more is planned for this milestone as far as I know. |
There've been no more issues on here this month, thus closing it. Please give me a shout if you run into any further problems! |
Most notable with regards to debugging vscode.
The text was updated successfully, but these errors were encountered: