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

@angular-devkit/build-angular 0.801.1: breakpoints not working in vscode #15116

Closed
jmesa-sistel opened this issue Jul 18, 2019 · 12 comments · Fixed by #15129
Closed

@angular-devkit/build-angular 0.801.1: breakpoints not working in vscode #15116

jmesa-sistel opened this issue Jul 18, 2019 · 12 comments · Fixed by #15129

Comments

@jmesa-sistel
Copy link

jmesa-sistel commented Jul 18, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [X] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: @angular-devkit/build-angular 0.801.0

Description

Breakpoints are not working in vscode since @angular-devkit/build-angular 0.801.1 version
If I go back to @angular-devkit/build-angular 0.801.0 breakpoints work fine

🔬 Minimal Reproduction

Add breakpoints in vscode and debug

🔥 Exception or Error





🌍 Your Environment




Angular CLI: 8.1.1
Node: 12.4.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.801.1
@angular-devkit/core         8.1.1
@angular-devkit/schematics   8.1.1
@schematics/angular          8.1.1
@schematics/update           0.801.1
rxjs                         6.4.0

Anything else relevant?

OS: win32 x64
Not tested in linux
Tested @angular-devkit/build-angular 0.801.2 also, and breakpoints are not working

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Jul 18, 2019
@alan-agius4
Copy link
Collaborator

Hi, can you please provide more information about the configuration in your .vscode/launch.json?

Are you following https://github.com/microsoft/vscode-recipes/tree/master/Angular-CLI and specifying the correct sourceMapPathOverrides?

@jmesa-sistel
Copy link
Author

jmesa-sistel commented Jul 18, 2019

@alan-agius4
This is my launch.json since angular 5, the project began in January 2018

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Chrome against jira, with sourcemaps",
            "type": "chrome",
            "request": "launch",
            "disableNetworkCache": false,
            "url": "http://localhost:2990/jira/plugins/servlet/es.sistel.plugins.jira.bps/ide/editor",
            "webRoot": "${workspaceRoot}"
        },
        {
            "name": "Launch Chrome HMR against localhost, with sourcemaps",
            "type": "chrome",
            "request": "launch",
            "disableNetworkCache": false,
            "url": "http://127.0.0.1:4200/jira/editor",
            "webRoot": "${workspaceRoot}"
        },
        {
            "type": "chrome",
            "request": "attach",
            "name": "Attach to Chrome",
            "port": 9222,
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}",
            "url": "http://127.0.0.1:2990/"
        }
    ]
}

I never need to add sourceMapPathOverrides, since angular 4.

PS
If I add sourceMapPathOverrides everything works again. Is this expected?

"sourceMapPathOverrides": {
                "webpack:/*": "${webRoot}/*",
                "/./*": "${webRoot}/*",
                "/src/*": "${webRoot}/*",
                "/*": "*",
                "/./~/*": "${webRoot}/node_modules/*"
            }

Should I close the issue?

As you can see in the commit this is specific for angular 8.1:
Update sourceMapPathOverrides for angular-cli 8.1
The original issue in VSCode: Chrome Debugger once again doesn't break on breakpoints in typescript with Angular 8.1

@alan-agius4
Copy link
Collaborator

@jmesa-sistel, found the culprit that was causing this and made breaks work only with sourceMapPathOverrides

@roblourens
Copy link

What version of angular-cli will the fix go into? Can you check that it still works even with those sourceMapPathOverrides set? I want to make sure that our recommendation works and that we don't need to update it to say "use A for version X and B for version Y"

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jul 20, 2019

sourceMapPathOverrides overrides will still work. The fix will be available in 8.1.2.

Edit The fix will be available in 8.1.3

@CreativeHouseDotOrg
Copy link

CreativeHouseDotOrg commented Jul 22, 2019

Seems like only reverting angular back to version 7.2.15 has fixed the breakpoint issue in visual studio community 2019 for me and I can look in to my breakpoints again.

@jmesa-sistel
Copy link
Author

@alan-agius4 I guess you mean 8.1.3, because the problem is in 8.1.1 & 8.1.2. For me 8.1.0 is working fine.
Will you close the issue or should I close it?

@alan-agius4
Copy link
Collaborator

The issue will be closed automatically once the fix is merged. Yeah indeed the fix version will be 8.1.3.

vikerman pushed a commit that referenced this issue Jul 25, 2019
…ints

`namespace` is always empty which is breaking sourcemaps since when sources start with `/` vscode will not be able to resolve them unless users configure `sourceMapPathOverrides`.

Fixes #15116
vikerman pushed a commit that referenced this issue Jul 26, 2019
…ints

`namespace` is always empty which is breaking sourcemaps since when sources start with `/` vscode will not be able to resolve them unless users configure `sourceMapPathOverrides`.

Fixes #15116
@jmesa-sistel
Copy link
Author

jmesa-sistel commented Jul 26, 2019

@alan-agius4
The issue is not fixed. I need sourceMapPathOverrides to get breakpoints working in 8.1.3.
Should I create a new issue?

Ohh My bad, @angular-devkit/build-angular: 0.801.3 is not out yet.

@CreativeHouseDotOrg
Copy link

Ohh My bad, @angular-devkit/build-angular: 0.801.3 is not out yet.

But it's still a good question. When will it be available?

@jmesa-sistel
Copy link
Author

jmesa-sistel commented Jul 30, 2019

@alan-agius4
Is not working for me. When I execute .scripts in debug console I can see:
- ./src/app/shared/iframe/iframe.component.html (c:\Proyectos\BPS\src\webapp\jira\src\app\shared\iframe\iframe.component.html)

and it should be:

- ./src/app/shared/iframe/iframe.component.html (c:\Proyectos\BPS\src\webapp\src\app\shared\iframe\iframe.component.html)
I can see jira word which is my base href in angular.json ("baseHref": "/jira/")

PS:
Now to get breakpoints working I have to add:
"./*": "${webRoot}/*", to sourceMapPathOverrides

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.