browser-sync: Unexpected Page Reload after Pausing in Debugger
Steps to reproduce/test case
- Add a breakpoint in Chrome debugger
- Wait until execution stops and hold on for a few seconds
- Continue via F8 to or click the play button
- Unexpectedly, the entire page is refreshed and the code runs from beginning
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [2.24.6]
- Node [v10.8.0]
- Npm [6.2.0]
Affected platforms
- Windows 10 x64
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
browserSync.init({
server: ["./webapp/", "./webapp/test", "./"],
index: "index.html",
notify: false
});
References
There are already two Stack Overflow posts:
- https://stackoverflow.com/questions/51589521/browser-refresh-after-breakpoint
- https://stackoverflow.com/questions/51762881/browser-getting-refreshed-after-resuming-debugger
And a message in Slack:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 10
- Comments: 27 (5 by maintainers)
Links to this issue
Commits related to this issue
- Browser-sync downgrade page reloads when debugging and stoping on breakpoints. see : https://github.com/BrowserSync/browser-sync/issues/1591 — committed to Heigvd/Wegas by CiGit 6 years ago
- Prevent browser reload on new ws connections Solves https://github.com/BrowserSync/browser-sync/issues/1591 — committed to chiplay/browser-sync by chiplay 6 years ago
- fix: Unexpected Page Reload after Pausing in Debugger - fixes #1591 — committed to BrowserSync/browser-sync by shakyShane 6 years ago
I have this problem as well. I have had some success by increasing the client heartbeat timeout:
Is this issue is resolved with 2.25.1 ?
Hi all, this is being worked on as a priority - thanks for your patience 😃
I can confirm @mpelekh’s report as well. Increasing the
heartbeatTimeoutdoesn’t prevent the reload, it just delays it. It my case, if I set a breakpoint, hit it, and then immediately resume, then wait until the 60 seconds is up, it will refresh the browser.@alexpmorris glad to hear it 😃
just had to add how happy I am as well that this one was nipped in the bud, it’s been driving me bonkers as well! 😄 lol
I have no issue with
browser-sync@2.24.4, so I digged a bit:socket.io@2.1.1https://github.com/BrowserSync/browser-sync/commit/dd70eba92b61f99bf9d67a6fcd825ee1d6e91964engine.iohas been updated in that version ofsocket.iohttps://github.com/socketio/socket.io/commit/b1941d5dfe3d2530bb0f0391088d3c8765ae9695engine.io@3.2.0https://github.com/socketio/engine.io/commit/65b1ad1b8a95fb0547ee3f286c1b7da299c7735aSetting
heartbeatTimeout: 60000works also for me 👍