Skip to content

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

Closed

Description

@abner

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.

Activity

  1. filipesilva commented on Aug 23, 2016

    @filipesilva
    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.

  2. abner commented on Aug 24, 2016

    @abner
    ContributorAuthor

    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.

  3. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Aug 28, 2016
  4. rubaomin commented on Aug 29, 2016

    @rubaomin

    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

  5. abner commented on Aug 29, 2016

    @abner
    ContributorAuthor

    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.

  6. added this to the milestone on Sep 19, 2016
  7. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    and removed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Sep 19, 2016
  8. filipesilva commented on Sep 26, 2016

    @filipesilva
    Contributor

    @abner so is this fixed for you?

  9. abner commented on Sep 27, 2016

    @abner
    ContributorAuthor

    no @filipesilva . it isn't fixed.

  10. adstep commented on Oct 18, 2016

    @adstep

    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
  11. chadbr commented on Oct 20, 2016

    @chadbr

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

  12. mdanetzky commented on Jun 10, 2017

    @mdanetzky

    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!

  13. filipesilva commented on Jun 12, 2017

    @filipesilva
    Contributor

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

  14. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  15. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions