angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Issue debugging beta.18. Sourcemap issue?

Open EricBichara opened this issue 10 years ago • 10 comments

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

EricBichara avatar Oct 27 '16 06:10 EricBichara

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

patrickoneill46 avatar Oct 27 '16 09:10 patrickoneill46

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

Steveiwonder avatar Oct 27 '16 09:10 Steveiwonder

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

zackarychapple avatar Oct 27 '16 12:10 zackarychapple

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

EricBichara avatar Oct 27 '16 12:10 EricBichara

@EricBichara just the project.

zackarychapple avatar Oct 27 '16 12:10 zackarychapple

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.

chadbr avatar Oct 27 '16 13:10 chadbr

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

Autushka avatar Oct 27 '16 16:10 Autushka

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

michaeloryl avatar Nov 02 '16 18:11 michaeloryl

Fixed in https://github.com/angular/angular-cli/pull/2857

filipesilva avatar Nov 02 '16 18:11 filipesilva

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.