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

Source Code showed in Browser Developer Tools is showing instrumented source code. #1798

Closed
abner opened this issue Aug 22, 2016 · 11 comments · Fixed by #2840
Closed

Source Code showed in Browser Developer Tools is showing instrumented source code. #1798

abner opened this issue Aug 22, 2016 · 11 comments · Fixed by #2840
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Comments

@abner
Copy link
Contributor

abner commented Aug 22, 2016

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.

@filipesilva
Copy link
Contributor

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.

@abner
Copy link
Contributor Author

abner commented Aug 24, 2016

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.

@filipesilva filipesilva reopened this Aug 28, 2016
@filipesilva filipesilva added command: test P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Aug 28, 2016
@rubaomin
Copy link

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

@abner
Copy link
Contributor Author

abner commented Aug 29, 2016

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.

@hansl hansl added this to the RC1 milestone Sep 19, 2016
@filipesilva filipesilva added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Sep 19, 2016
@filipesilva
Copy link
Contributor

@abner so is this fixed for you?

@abner
Copy link
Contributor Author

abner commented Sep 27, 2016

no @filipesilva . it isn't fixed.

@adstep
Copy link

adstep commented Oct 18, 2016

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

@chadbr
Copy link

chadbr commented Oct 20, 2016

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

@mdanetzky
Copy link

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!

@filipesilva
Copy link
Contributor

We seem to have a regression in unit test sourcemaps, investigating in #6583.

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
7 participants