-
Notifications
You must be signed in to change notification settings - Fork 12k
Debugging not working well in Webpack Branch #1519
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
Comments
Some issue on Chrome dev tools side, AFAIK |
@sirajc It's also not working in Firefox for me. |
I've noticed this actually. If I place a breakpoint inside a mapped TS file, the breakpoint will move up the file about 10-20 lines above and obviously not work. It seems the maps aren't quite correctly generated |
I believe this is a Typescript-mapping problem only. Mapping onto Javascript files (e.g. node dependencies) work fine. |
@TheLarkInn Can you have a look please |
I have also noticed that console errors point to lines far from where the actual error occurred |
Tried to update to the latest Angular CLI Beta 11 Webpack, (NPM) but not worked. |
Actually, for me it's sometimes not working properly even before upgrading to webpack (using PhpStorm) |
@Namek Do you mean the Webpack Branch or just the Masterbranch where Webpack is inside? |
I just looked again at this issue and to be more specific; I'm having the same problem on Firefox and Internet Explorer. @TheLarkInn got some progress on this one? |
Yesterday I didn't even touch anything related to webpack in this project. Maybe my webstorm is broken. |
Actually the problem is being caused by the sourcemap-istanbul-instrumenter-loader which was setup to always instruments the typescript app code in the webpack-build-test.js. Would be better to have a task specific for coverage where the instrumentation would take place. The test tasks will run without instrumentation so we could debug it. |
We did just cut a new release on the webpack tag this morning with improved coverage settings. Would you mind just double checking if mappings work on prod and dev. |
@TheLarkInn going to check it today! |
The issue isn't the coverage itself. Coverage is OK in master branch. The problem is the instrumented code, when you debug the tests on karma http://localhost:9876/debug.html. All the application code will look like this: If i just comment out this part of node_modules/angular-cli/addon/ng2/models/webpack-build-test.jswebpack-build-test.js:
And run karma again, so i will be capable of debug the code: But obviouslly i won't have any coverage data : My proposal is to have two different tasks:
I would try make this changes and submit a merge request. |
Maybe the Karma fixed the problem? But my problem was debugging of just the Source Codes. like app.component.ts etc. etc. This evening im gonna test it. |
So in test you actually get the sourcemaps for your spec files. So set a breakpoint and you will see those correctly. |
We're still investigating sourcemaps on prod and dev modes though. |
@TheLarkInn Nice to hear that, hopefully we find a quick solution for it! :) Now only can console.log hehe |
So we will have to change these to |
You can see more information about how webpack processes sourcemaps are configured here and what the tradeoffs are |
@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 👍 |
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 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. |
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). |
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 NPM: 3.10.8 |
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) |
@nukuuk was it working fine with beta18? |
@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 |
reverting to beta17 did the trick for me |
instead of reverting you could use this patchy fix from issue #2811 : |
The issue was back on |
I'm still seeing this ➜ web git:(master) ✗ ng -v |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Windows 10
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:Beta 10 (webpack / master branch)
do on your code? etc.
more information.
5. Mention any other details that might be useful.
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.
The text was updated successfully, but these errors were encountered: