browser-sync: Unexpected Page Reload after Pausing in Debugger

Steps to reproduce/test case

  1. Add a breakpoint in Chrome debugger
  2. Wait until execution stops and hold on for a few seconds
  3. Continue via F8 to or click the play button
  4. 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:

And a message in Slack:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 10
  • Comments: 27 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I have this problem as well. I have had some success by increasing the client heartbeat timeout:

browserSync.init({
...
    socket: {
        clients: { heartbeatTimeout: 60000 } 
    }
...
});

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 heartbeatTimeout doesn’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:

  1. I think the issue started here with the update of socket.io@2.1.1 https://github.com/BrowserSync/browser-sync/commit/dd70eba92b61f99bf9d67a6fcd825ee1d6e91964
  2. engine.io has been updated in that version of socket.io https://github.com/socketio/socket.io/commit/b1941d5dfe3d2530bb0f0391088d3c8765ae9695
  3. Default value for timeout was decreased in engine.io@3.2.0 https://github.com/socketio/engine.io/commit/65b1ad1b8a95fb0547ee3f286c1b7da299c7735a

Setting heartbeatTimeout: 60000 works also for me 👍