-
Notifications
You must be signed in to change notification settings - Fork 290
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
Debugger brakes rapidly on app load #597
Comments
This is working as designed; we ask Chrome to pause before executing scripts with sourcemaps so that we can make sure to set breakpoints in time. As of #562 we'll skip doing that if there's no breakpoints set. I'm not yet sure if there's a way we can signal devtools to not flip out like that. |
Hi @connor4312, we are experiencing something similar to this on node startup and attachment. The debug stops on random lines of internal node code that have no breakpoints. This only started happening in recent builds. |
This should not happen in Node (+ Node doesn't support the sourcemap breakpoint used in browsers). Can you capture a trace log using these instructions?
|
Hi @connor4312, Thanks for the speedy response. I have provided a screenshot of the random stops .. this happens several times before hitting the breakpoint. This is our config for the attach
|
Because of this and probably some other changes, our application now takes TWO minutes to load with the vscode debugger on each refresh. The debugger was never any good but this is absolutely terrible for me. I'll just use the built-in chrome/firefox debugger for now. |
@Krakenz apps shouldn't take that long! Please collect a trace log using these instructions:
|
@connor4312 there it is: [redacted] |
@Krakenz thanks for the log! You're running into #598 which is fixed in the latest nightly build. |
@connor4312 thanks! looks like installing the nightly build of "vscode-js-debug" solved my issue as well |
Good to hear! I'll keep this issue open to attempt to address the cosmetic flickering issue. It will still happen even with that fix (just a couple times, though, instead of hundreds). |
We will need a fix in Chrome for this. Tracking this here: https://bugs.chromium.org/p/chromium/issues/detail?id=1131204 |
I'm hitting the same issue as @Krakenz where our app starts very slowly (> 30s) on initial startup and reload while the debugger flashes repeatedly, when there is a breakpoint set. It's been doing this for a while. We're not using Angular though, so maybe it's some other edge case than #598? @connor4312 I've collected the logs and sent them to you by email. For the record, here's what it looks like. It's bad enough to prevent us from using the VS Code debugger entirely. Screen.Recording.2020-12-22.at.10.20.48.AM.mp4 |
You may be able to add I'm curious what your build setup looks like? |
When I add
Can you see what triggers the debugger pause so often from the logs? We use a mostly standard webpack build setup, although the on-disk layout might be a bit unorthodox. It's split into two root folders:
We trigger a build by invoking, from the app's root, a script that's defined in our library's I don't know if that on-disk layout might somehow prevent the automatic detection in P.S.: The |
Thanks for the logs. It looks like it's actually working correctly, but in your code is still hitting a lot -- normally we request the runtime to pause before any script with a sourcemap, but with I will have to think of the best way to deal with this. In the meantime you can also get around this issue by using a non-module devtool mode such as |
Oh, makes sense! We use the component folder pattern so we in fact have one I'll take a look at the |
I believe I am having running into that same issue as @Krakenz and @fortinmike as well. The repo is fairly large, and the slow down at startup is in the 4-5 minute range which makes using the vscode-js-debug practically unusable. If no breakpoints set or enabled, things start up in a reasonable amount of time, and the chrome debugger doesn't do the 'flash repeatedly' thing. If I wait till after the webpack Using Like @fortinmike we are using Here is my launch config.
Here's the log... I'd really like to get this resolved so I can debug in vs-code otherwise I need to find a different option. Please let me know if there is further information that can provide that will help. Update: I checked the latest nightly build. It behaves the same way. :( |
I'm experiencing the same issue with VSCode + Chrome debugging. The app takes very long to load in Chrome with these debugger pauses. Closing the Chrome Developer Tools panel helps to drastically speed up the loading but we're using an auto refreshing feature on source code updates which makes it very hard to work with. Constantly toggling Chrome DevTools on and off is just disturbing. I tried adding that OS: Unbuntu 22.04 |
Hey, I'm still experiencing this same issue with VSCode & Chrome debugging as well. The webpage flashes rapidly whenever loading/reloading the page if you have breakpoints enabled in VSCode AND have the chrome DevTools opened. A workaround I could see if there was some hook we could attach to in our launch options to run a task. That way we could at least issue the command But I mainly wanted to just bump this issue. |
I've also run into this with a vite setup. A workaround is to only set breakpoints in the chrome console, and then debugging in vscode works as before with our webpack setup. It would be great if there was an config option to match on more of the file path along with the |
I originated microsoft/vscode#211815 earlier today. After the very helpful suggestion of @IllusionMH, I've searched the comments here for a workaround to my issue and haven't found any. I'm happy to instrument my project if that's helpful, and upload a logfile. I'll be using the Chrome developer tools in the meantime (I can't live with a 2+ minute startup time on every relaunch). |
I've attached the gzipped log for your convenience: |
I offer the following data for motivation, context and clarity. When I opened my now-closed issue yesterday, the CLOCK time (measured with a stopwatch) of my React dashboard app was 2:35 -- 2,100 seconds. The instrumented time for my workaround (bypassing the VSC debugger altogether) is 253 msec. The VSC debugger adds FOUR ORDERS OF MAGNITUDE to the startup time. The workaround I've been using since my last entry here yesterday is to run "yarn dev" from a command shell (outside VSC), open a regular Chrome browser on the development URL reported by VITE, and use the Chrome developer tool for breakpoints, value inspection, and console logs. The convenience of having my debugger integrated with my IDE is worth something, perhaps even one order of magnitude. I invite any guidance this community might offer regarding coding practices or bundling that might help workaround this issue. I've already refactored the JS code to do a single bulk import at startup and avoid individual import statements in the rest of the code base. That seems to have made no difference at all. I follow a practice of providing one JS class per file -- I really like VSC and I very much want to resume using the builtin debugger. I just can't afford a penalty of four orders of magnitude in startup time. |
I've just tried this on my dashboard and it works well. So long as I set each breakpoint in Chrome developer tool (and NOT the VSC debugger), then startup time is fine and VSC navigates to the desired location with the desired information in the "Run And Debug" view. NOTE: The Chrome developer tools must be opened for the in-browser breakpoints to take effect. |
Having to set the breakpoints in is a bit roundabout and introduces extra friction. It's a good work around, but yeah it would be nice to have a solution that enables breakpoints to be set in VSCode directly one day. |
I was able to fix this by modifying my client config like this,
|
Has anyone tried to fix this? This thing is going crazy everytime I open up the devTools when debuggin with nextjs. This is a recommended setup. {
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
},
"skipFiles": ["<node_internals>/**/*.js", "node_modules/**/*.js"]
} Becasue of this flip, the page loading is basically not responding. At first it was semi-acceptable becuase there are just a few, but then I added a chart element and this thing went crazy, keeps breaking into There is a workaround where you don't use this config, so effectively turning off the debug attached on frontend. Use the: {
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn run dev"
}, And then manually set breakpoints in chrome's dev tool if you must. I am just surprsied to see this issue go on for 4 years and no solution. Lol. Also tbh I am not sure who is causing this issue, is it Chrome? Is it this extension? Or something else. |
Resetting (as suggested in this answer) helps for a bit, but then it starts again. It also appears not to happen in Firefox Developer edition. |
Describe the bug
I installed the latest version of vscode today (with the new debugger) and since then every time I run the app the debugger brakes and continues rapidly until the app loads (see attached gif).
(lunching the app from chrome directly will not cause that issue)
About the setup:
I am running Angular 8.2.3
with chrome dev tools open:
I also tried to see if adding
remote-debugging-port=9876
makes any difference, and it didn't.Log File
I noticed there are a lot of calls to
Debugger.resumed
in the log, but I am not sure what's causing it and how to continue from here.vscode-debugadapter-1.json.gz
VS Code Version: 1.47
Additional context
OS: windows 10
I am using HMR but I also tried without it, go similar results.
Thanks!
The text was updated successfully, but these errors were encountered: