Angular-cli: Source Code showed in Browser Developer Tools is showing instrumented source code.

Created on 22 Aug 2016  路  11Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Ubuntu 16
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

angular-cli: local (v1.0.0-beta.11-webpack.2, branch: master)
node: 6.3.0
os: linux x64

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

When trying to debug my tests the source code mapped is showing illegible because of the instrumented code needed for the coverage report feature.

As seen in the screenshot bellow:

I think we could have an argument debug which we would pass to the ng test task which will not run the coverage config parts and, this way, debug will be possible.

I already have this implemented here and will submit a merge request for that.

  1. The log given by the failure. Normally this include a stack trace and some
    more information.
  2. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

1 (urgent)

Most helpful comment

no @filipesilva . it isn't fixed.

All 11 comments

We had an issue with sourcemaps but it should be solved in the next release (or in master if you want to try). If not, please tell me so I can reopen this issue.

I just tried It on master and it is not solved. It's related to instrumentation. The only way i think we have to solve this is to have an option to turn of the instrumentation, like I proposed with the debug argument on test tasks in the pull request.

I had a similar problem. My version is "angular-cli: 1.0.0-beta.11-webpack.2".
When ran the command "ng serve" an hour to another, debug crashed.
I was many hours doing everything changed browser, IDEs, did a master reset on the node modules and nothing resolved.
After much research, I found an open question in "webpack" and was resolved with 'devtool: '#inline-source-map'in the settings.
So I searched the angular-cli sources to see if something tracked.
I found that the setting "devtool" in the files used in the dev environment (not production) in "..\node_modules\angular-cli\addon\ng2\models\" were configured with "devtool: 'inline-source-map" except one, "webpack-build-development.ts".
This was the setting "devtool: 'cheap-module-source-map'" and changed it to "devtool: 'inline-source-map'" to try 'ng serve' and it worked.
The "ng serve" returned to debug in a way (with sourcemaps generated correctly).
I do not know why it was that setting, but until that is resolved by the team the right way, is my tip.
I hope I can help someone not to lose hours like me just trying to debug my project that stopped working debug an hour to another.
:D

This does not occurred to me using master angular-cli. The latest version published in npm is old and may have this issue. Try install angular-cli form master and create a app. After that change the package.json updating the angular-cli dependency to point to github master also (check the revision number and use the same version) of the angular-cli installed globally.

@abner so is this fixed for you?

no @filipesilva . it isn't fixed.

I am still seeing this issue. When running 'ng test' the non spec files aren't displaying the sourcemapped content.

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 10
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    1.0.0-beta.17

Same here - beta.17 on mac... can't debug through source from spec's

Angular cli 1.1.1

ng new debugtest
cd debugtest
ng test

in the browser -> Debug -> developer tools / sources -> cmd+p ->
cannot find app.component.ts!

We seem to have a regression in unit test sourcemaps, investigating in https://github.com/angular/angular-cli/issues/6583.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajjejosefsson picture rajjejosefsson  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

5amfung picture 5amfung  路  3Comments

daBishMan picture daBishMan  路  3Comments

hartjo picture hartjo  路  3Comments