question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unbound breakpoint in Angular project & Could not read source map

See original GitHub issue

Break point set in .ts files are being shown as unbound breaking point. If I were to put a “debugger” instead of break point, it hits the compiled “.js” file instead of the “.ts” file. It was working as intended before the update.

this is my launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome",
            "url": "http://localhost:4200",
            "webRoot": "${workspaceFolder}",
            "sourceMaps": true,
            "sourceMapPathOverrides": {
                "/./*": "${webRoot}/*",
                "/src/*": "${webRoot}/*",
                "/*": "*",
                "/./~/*": "${webRoot}/node_modules/*"
            }
        }
    ]
}

I tried adding

"resolveSourceMapLocations": [
    "${workspaceFolder}/**",
    "!**/node_modules/**"
]

Without any success

this error is being shown on the debug console. image

and this is the trace file

vscode-debugadapter-438f1773.json.gz

Thank You in advance

VS Code Version: 1.63.1 OS Version: Linux Manjaro KDE

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AbhiramTScommented, Jan 11, 2022

an update…there is no issue when serving with “–host=127.0.0.1” but the issue is still there when I try it with “localhost”…any thoughts…

0reactions
connor4312commented, Jan 31, 2022

In https://github.com/microsoft/vscode-js-debug/commit/bc90de2b23442d68efb6e9304e28fe1a77dcb3fd we now try both localhost and 127.0.0.1 if we see a “connection refused” type of failure which I think should resolve this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unbound breakpoint - Angular, VS Code, Chrome, PWA
Mine is a PWA and I always have an unbound breakpoint when starting with "ng serve". Tried change in angular. json: "sourceMap": true...
Read more >
TypeScript debugging with Visual Studio Code
TypeScript debugging supports JavaScript source maps. To generate source maps for your TypeScript files, compile with the --sourcemap option or set the ...
Read more >
Debug Angular apps in production without revealing source ...
I like to use the npm module http-server as local web server. So let's run our production build and open the dev tools...
Read more >
How to properly set up vs code to debug an Angular project in ...
How to properly set up vs code to debug an Angular project in windows ... Under the tab Source, you can see your...
Read more >
Debugging Angular with VS Code & Setting Breakpoints
It's really easy to set up and debug your Angular project with Visual Studio Code. This video covers just how simple the process...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found