Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Ubuntu 16- Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand paste the result here:
angular-cli: local (v1.0.0-beta.11-webpack.2, branch: master)
node: 6.3.0
os: linux x64
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.
Thanks! We'll be in touch soon.
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.
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._
Most helpful comment
no @filipesilva . it isn't fixed.