livereactload icon indicating copy to clipboard operation
livereactload copied to clipboard

Breakpoints not hitting in Chrome

Open kyle-ssg opened this issue 8 years ago • 8 comments

Thanks for making this, it's going to make life so much easier once it's all setup!

Having integrated this into my gulp process I'm finding that none of my breakpoints hit in chrome (prior to any patching). Weirdly enough this all seems fine in Firefox.

Any guidance would be greatly appreciated.

kyle-ssg avatar Feb 21 '16 19:02 kyle-ssg

Chrome was just having a hissy fit it seems :)

kyle-ssg avatar Feb 21 '16 19:02 kyle-ssg

This issue appears to be present in latest release - I can set breakpoints but they are never hit. I'm using the example here https://github.com/milankinen/livereactload/tree/master/examples/03-build-systems

UPDATE: Breakpoints are hit in Firefox

itsravenous avatar Jan 09 '17 10:01 itsravenous

Hi @kyle-ssg & @itsravenous!

Have you noticed that LiveReactload suffixes reloaded script files with rev=<revision_num> (please see e.g. #141)? Unfortunately (at least) Chrome treats the suffixed files as separate scripts so breakpoints from the old revision don't propagate to the next one. 😕

If anyone knows solutions to this issue, all help is welcome!

milankinen avatar Jan 09 '17 17:01 milankinen

@milankinen thanks for the swift response! I saw the rev= issue initially, but it goes away after first refresh (yep, super weird I know) and Chrome shows my breakpoints persisting on reload; they just aren't getting hit!

itsravenous avatar Jan 09 '17 17:01 itsravenous

Wait, I lied :D Yes, when I make an edit to a component, a rev=<revision_number> is added, so yes, Chrome sees it as a different file. But that's a separate issue, which I'll open now (#147)

itsravenous avatar Jan 09 '17 18:01 itsravenous

If I add a debugger statement in my code, Chrome pauses on that, and any subsequent breakpoints are also hit. So I can work around this for now when I need to debug, but I hope someone with debugger smarts can figure it out!

itsravenous avatar Jan 09 '17 18:01 itsravenous

OK, so breakpoints that should be hit when the page is [re]loaded aren't hit, but if I place a breakpoint in the render() function of a component then it will get hit when the component re-renders (because of state change or whatever). So not as bad as I initially thought.

itsravenous avatar Jan 09 '17 18:01 itsravenous

Can you try again with 3.3.0 please?

EugeneZ avatar Mar 14 '17 00:03 EugeneZ