You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Request: hit breakpoints in browser dev tools #425
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
Do you want to request a feature or report a bug?
When serving in development mode (npm start), one can open browser on http://localhost:3000/. When setting a breakpoint, e.g. in home.ts, and reloading page, execution should pause on that line.
What is the current behavior?
Breakpoint seems to be ignored. Execution proceeds beyond that. Client app runs normally, no particular errors.
What is the expected behavior?
Execution should pause on breakpoint set.
What is the motivation / use case for changing the behavior?
Debugging purposes.
We definitely found some differences with sourcemap. Initially we tried with devtool: 'cheap-module-eval-source-map', that should be faster for development rebuilds. But breakpoints did not work with this.
Then we tried with (slower) devtool: 'source-map' and breakpoints are hit.
Reacted by Sam Vloeberghs, Juri Strumpflohner, Alexander Nazarov, Maximilian Alexander, Tim Sandberg, ramandv, Sam Lin, Phil Léger and Jozef Lelič
Just to clarify, I used cheap-module-eval-source-map. From Chrome Dev Tools, when I clicked in main.bundle.js to set a break point, I expected Chrome to open open my class (in typescript). The break point would land on the ugly javascript in main.bundle.js. But who can read this?
I followed @BrainCrumbz suggestion. I'm able to click in the javascript source and Chrome resolves the breakpoint in the respective typescript class.
@BrainCrumbz are you able to hit breakpoints with "sourcemap" when using HMR ?
with I run with server:dev:hmr (which is npm run server:dev -- --inline --hot), hot module works but when it does the hot-reload I can't hit the same breakpoint.
Initial state after starting server:dev:hmr:
Breakpoint is set.
I add console.log("hot") to my code, and after the hot reload this happen:
Sorry, we're not using this starter at the moment, and I've not checked back this issue recently. Maybe someone else more up-to-date with the project can reply.
sorry this may sound super rule but I'm closing long standing issues and refactoring the codebase. If you run into this problem again feel free to open another issue
Activity
dvulanov commentedon Mar 21, 2016
+1
Breakpoints don't work in constructors or event hooks (like OnInit, AfterViewInit, etc...). For me, they do work during regular method callbacks.
If a new non-event lifecycle breakpoint is not being hit, refresh the page and it should.
(using beta 9 and Chrome dev tools)
samvloeberghs commentedon Mar 23, 2016
same here, using the new setup, my breakpoints are not working anymore. Perhaps something to do with the sourcemaps implementation used?
BrainCrumbz commentedon Mar 23, 2016
We definitely found some differences with sourcemap. Initially we tried with
devtool: 'cheap-module-eval-source-map', that should be faster for development rebuilds. But breakpoints did not work with this.Then we tried with (slower)
devtool: 'source-map'and breakpoints are hit.samvloeberghs commentedon Mar 24, 2016
@BrainCrumbz : I can also confirm this
largeDachshund commentedon May 11, 2016
Just to clarify, I used cheap-module-eval-source-map. From Chrome Dev Tools, when I clicked in main.bundle.js to set a break point, I expected Chrome to open open my class (in typescript). The break point would land on the ugly javascript in main.bundle.js. But who can read this?
I followed @BrainCrumbz suggestion. I'm able to click in the javascript source and Chrome resolves the breakpoint in the respective typescript class.
Thanks, @BrainCrumbz !
BrainCrumbz commentedon May 19, 2016
You're welcome! Happy to be helpful @largeDachshund
phil-lgr commentedon Oct 17, 2016
@BrainCrumbz are you able to hit breakpoints with "sourcemap" when using HMR ?
with I run with
server:dev:hmr(which isnpm run server:dev -- --inline --hot), hot module works but when it does the hot-reload I can't hit the same breakpoint.Initial state after starting
server:dev:hmr:Breakpoint is set.
I add
console.log("hot")to my code, and after the hot reload this happen:BrainCrumbz commentedon Oct 18, 2016
Sorry, we're not using this starter at the moment, and I've not checked back this issue recently. Maybe someone else more up-to-date with the project can reply.
PatrickJS commentedon Sep 2, 2017
sorry this may sound super rule but I'm closing long standing issues and refactoring the codebase. If you run into this problem again feel free to open another issue