SOLUTION – 3/15/23 – Update VS Code to 1.76.2. MS has fixed this bug in this release.
I’m using VS Code (v1.65.2), my Angular (15.1.2) project is client side and my .Net (6.0) app is server side and when I launch the VS Code debugger I run my launch compound like this below and have been to doing it like this for 2+ years:
"compounds": [{
"name": "Server/ClientChrome",
"configurations": [".NET6 Launch (no web)", "Launch Pwa-Chrome"]
}],
"configurations": [{
"name": "Launch Pwa-Chrome",
"type": "pwa-chrome",
"request": "launch",
"url": "https://localhost:4200",
"webRoot": "${workspaceFolder}/client"
},
{
"name": ".NET6 Launch (no web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/API/bin/Debug/net6.0/API.dll",
"args": [],
"cwd": "${workspaceFolder}/API",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
]
Everything was working fine until tonight when I made some changes to different component files, service files and some changes in a few different controllers, server side.
PROBLEM – Now when I start the debugger and Chrome launches and opens up there is nothing but a blank white screen and the spinner around the tab icon just keeps spinning. I can’t open Chrome’s debugger window/tools by right clicking and I see no errors in the debug console in VS Code.
FYI – If ng serve is running, I can hit localhost:4200 and see the site and if I run the site from the server side (>dotnet run) I can get to the site and see it at localhost:5001.
PROBLEM – BUT if I run both from my launch.json file, using the compound above, the Chrome browser just opens and the spinner around the icon just keeps spinning. I can’t even open a debug window.
I thought I might be in some weird state so I tried all these below with no success.
- Restarted VS Code and restarted ng server
- Restarted my computer
- Tried launching the VS Code debugger using pwa-msedge (browser opened to same blank screen with loading but nothing displayed)
- Cleared all items from Chrome cache
- Uninstalled any ad blocker that might cause this
- Ran >ng build and >dotnet build with no errors
- let the Chrome window stay open for 1+ minute to see if it would eventually load
- Ran >ng lint, which I never use, and received this message:
An unhandled exception occurred: Cannot find builder "@angular-devkit/build-angular:tslint".
See "/private/var/folders/l6/zz0rl4793838rf924b4y0tqc0000gn/T/ng-bVaXzT/angular-errors.log" for further details.
My issue has never happened before and I’m guessing it might be related to some Angular file I changed, but I don’t see any config or json file in the source control section that has been changed that might cause this.
QUESTION – Anyone have any ideas on how to debug this to determine why the site isn’t loading correctly when I launch the debugger?
UPDATE – 3/15/23 updating VS Code to 1.76.2 fixes this issue. MS just put this release out this morning to fix this bug.
5
Answers
Seeing similar in VS Code 1.76.1. If there is a breakpoint set anywhere, the app doesn’t load in debug mode. Clear breakpoints and app loads. Bug filed here: https://github.com/microsoft/vscode/issues/177092
I don’t know the exact cause, but this is an issue with a new Chrome version, either when Chrome is launched in debug mode or when a different profile is used (These happen when launching the debugger). Using a different browser, e.g. Edge works. Loading the application in normal (user profile) Chrome works (but of course then breakpoints are not hit).
I have not yet tried reverting to an older version of Chrome, but it should work again. Probably around version 109?
This is not restricted to just angular debugging, when the Browser is launched from Visual Studio when running a .net core application, similar things happen.
I was having the same issue. After uninstalling react extension from chrome and deleting all the breakpoints the problem was fixed.
If you start debugging in Edge then open a fresh instance of Chrome, you can copy the URL (eg. https://localhost:12354/) into Chrome and it seems to work. Breakpoints are being hit as expected.
Hope this helps.
Edge is version 111.0.1661.41.
Chrome is version 111.0.5563.65.
The project that I’m debugging is using .Net 6.0.
As mentioned in Chrome hangs when debugging in Visual Studio 2022 you can use Chrome Dev (https://www.google.com/chrome/dev/).
Looks like a fix is coming