Closed zatchgordon closed 5 years ago
+1
+1
I have the same issue, but I don't use lite-server. I found this issue when searching for "stop chrome from reloading after breakpoint".
After further testing, I have found that the same issue is true in Firefox, so it might be a browsersync issue.
For reference I use gulp serve
for development, and it triggers this issue.
EDITED: Okay, there is an open issue about this thing: https://github.com/BrowserSync/browser-sync/issues/1591#issuecomment-413621561
Work around this "bug" by adding this setting:
browserSync.init({
...
socket: {
clients: { heartbeatTimeout: 60000 }
}
...
});
If setting heartbeatTimeout doesn't work... you can run
npm i -D -E browser-sync@2.23.7
as mentioned in the thread roayalrex mentioned.
This worked for me. Marking as closed.
Chrome refreshing after breakpoint (break point) pause
When pausing on a break point via a the chrome debugger or via vs code and waiting more than 5 seconds (normally just inspecting an variable) and then continuing the code, chrome will refresh. I would expect chrome to not refresh and continue on with the code. The weird thing is if i continue the breakpoint immediately then chrome will not refresh. It's only when a breakpoint is stopped for and elongated period of time (5-20 seconds) that chrome will refresh.
The problem might have to do sort of with Chrome, but I've tried with IIS/visual studio and the same problem does NOT occur leading me to think it is a mix of lite-server/browsersync/chrome.
I have tried setting the browsersync settings of
"watch": false
"files": [""]
"files": ["index.html"]
but none of those seem to stop Chrome from refreshing when paused at a breakpoint for a more than a few seconds.Bug repro steps
Here are my normal settings and edited (trying to make the refresh not happen) settings for browsersync for running with
lite-server -c bsSettings.config.js
Normal settings
New settings trying to stop the bug from happening
lite-server -c bsSettings.config.js
Environment
lite-server
version: 2.4.0nodejs
version: 10.5.0npm
version: 6.1.0