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

Debugging not working well in Webpack Branch

Open masaanli opened this issue 10 years ago • 35 comments

Please provide us with the following information:

  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: Beta 10 (webpack / master branch)
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you

    do on your code? etc.

  4. The log given by the failure. Normally this include a stack trace and some

    more information.

5. Mention any other details that might be useful.


Thanks! We'll be in touch soon.

The debugging isnt working anymore in firefox, chrome or edge.

When I put a breakpoint nothing happens. When I put a debugger command, it's debugging at strange lines. not where I put the debugger command.

masaanli avatar Aug 02 '16 16:08 masaanli

@TheLarkInn thanks, but I can not find the webpack configuration file or the place where to create it?

Can't we release maybe a beta 11 webpack.3 otherwise :+1:

masaanli avatar Aug 12 '16 05:08 masaanli

Using a webpack config is only one of may ways to use webpack. It also can be invoked through node using the webpack nodeAPI which we do

TheLarkInn avatar Aug 12 '16 07:08 TheLarkInn

@TheLarkInn sorry for me being an asshole, but I'm new to Webpack. Need some guide on this how to acchieve applying this setting, so debugging is working. Sorry.

masaanli avatar Aug 12 '16 08:08 masaanli

if we add an arg --debug on ng test tasks we could conditionally not add the instrumenter plugin and not generate the coverage reports (because without the instrumenter the coverage info isn't generated). This way we would debug on tests also!

abner avatar Aug 12 '16 10:08 abner

Is this issue back in beta 18? I created a new project this morning (ng new testproject) and changed only 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 extends 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 also tested in my other projects which i've updated to beta.18 with the same issue.

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

running: Npm: 4.0.0 OSX: 10.12.1 Chrome: 54.0.2840.71

EricBichara avatar Oct 26 '16 05:10 EricBichara

Happening for me too. Source maps seem to be out by only a few lines, so breakpoints are out too (ridiculous workaround: surround breakpoint with lots of superfluous lines)

angular-cli: 1.0.0-beta.18 node: 6.7.0 os: win32 x64

NPM: 3.10.8 OS: Windows 10 x64 Chrome: 54.0.2840.71 m (64-bit)

sherwopj avatar Oct 28 '16 15:10 sherwopj

I am getting this debug/mapping mal-config problem too (same as @sherwopj). The debugging was working fine for a while, but after my app got to a critical mass (like around 20 components) it has started to get wonkie: breakpoints won't hit, or impossible to set breakpoint (off by x number of lines)

brendanalexdr avatar Oct 28 '16 18:10 brendanalexdr

@nukuuk was it working fine with beta18? We just migrated our app to use angular-cli and are suffering with this annoying issue. I tried downgrading to beta17 but other errors arose

fcrocce avatar Oct 28 '16 20:10 fcrocce

@fcrocce it was working ok with beta18 for a while, until my app reached a critical mass of components (around 25), then debugging got wonky

brendanalexdr avatar Oct 28 '16 20:10 brendanalexdr

reverting to beta17 did the trick for me

fcrocce avatar Oct 28 '16 22:10 fcrocce

instead of reverting you could use this patchy fix from issue #2811 : Edit node_modules/angular-cli/models/webpack-build-development.js and change cheap-module-source-map to source-map

ugacode avatar Oct 30 '16 11:10 ugacode

The issue was back on beta18, fixed on beta19-3 in https://github.com/angular/angular-cli/pull/2857.

filipesilva avatar Nov 03 '16 16:11 filipesilva

I'm still seeing this

➜ web git:(master) ✗ ng -v angular-cli: 1.0.0-beta.19-3 node: 6.7.0 os: darwin x64

rightisleft avatar Nov 18 '16 22:11 rightisleft

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.