Skip to content

Issue debugging beta.18. Sourcemap issue? #2909

Closed

Description

@EricBichara

OS?

Mac OSX 10.12.1

Versions.

angular-cli: 1.0.0-beta.18
node: 6.8.1
os: darwin x64

Npm: 4.0.0
Chrome: 54.0.2840.71

Repro steps.

new project created with "ng new testproject". Changed only to the following code in app.component.ts

import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  ngOnInit(): void {
    this.dosomething();
  }

  title = 'app works!';

  dosomething() {
    this.title = "trying to do something";
    this.title = "trying to do something else";
  }
}

In chrome dev tools, breakpoint doesn't seem to match the scope
screen shot 2016-10-26 at 07 20 26

I've tested in my other projects which i've updated to beta.18, get the same issue.

Also tried reinstalling angular-cli to make sure there where no issues there:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli
ng new testproject

Activity

  1. changed the title [-]Issue debugging beta.18.[/-] [+]Issue debugging beta.18. Sourcemap issue?[/+] on Oct 27, 2016
  2. patrickoneill46 commented on Oct 27, 2016

    @patrickoneill46

    Having this issue as well. It seems a 2-3 lines offset for me.

  3. Steveiwonder commented on Oct 27, 2016

    @Steveiwonder

    I have the same problem too, hits the break-point then when I attempt to step over it jumps to somewhere completely random.

  4. zackarychapple commented on Oct 27, 2016

    @zackarychapple
    Contributor

    after updating the project I was able to get this working again by going back down to beta.15 of just the cli.

  5. EricBichara commented on Oct 27, 2016

    @EricBichara
    Author

    Thanks @zackarychapple , did you change to beta.15 both globally and in the project?

  6. zackarychapple commented on Oct 27, 2016

    @zackarychapple
    Contributor

    @EricBichara just the project.

  7. chadbr commented on Oct 27, 2016

    @chadbr

    See the fix in #2811 from @un33k - this has been fixed in master for the next release.

    un33k commented 6 days ago • edited
    I also confirm the line number issue in beta.18. A quick workaround for me was to update this file node_modules/angular-cli/models/webpack-build-development.js in my project and replace cheap-module-source-map to source-map. Takes much longer to compile, but line numbers are matching on breakpoints.

  8. Autushka commented on Oct 27, 2016

    @Autushka

    @chadbr Thanks, modification of node_modules/angular-cli/models/webpack-build-development.js helped.

  9. michaeloryl commented on Nov 2, 2016

    @michaeloryl

    I have the same problem. In my case it is 10 lines off, as you can see in the screen shot below.
    breakpoint_offset_10

  10. filipesilva commented on Nov 2, 2016

    @filipesilva
    Contributor

    Fixed in #2857

  11. angular-automatic-lock-bot commented on Sep 6, 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.

  12. locked and limited conversation to collaborators on Sep 6, 2019
  13. added a commit that references this issue on Aug 29, 2023
    0e7dd9a
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions