browsersync reloads the browser when connection is restored (even though it doesn't need to reload)
See original GitHub issueIssue details
When a page has a high load (eg it takes 30 seconds to render) browsersync will have lost it’s connection and on reconnect it refreshes, this keeps on going until the server is stopped
Steps to reproduce/test case
use browsersync, make a page do some heavy lifting for 30 seconds then watch as the page keeps refreshing just after crunching for a while
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.24.6 ]
- Node [ 8.11.4 ]
- Npm [ 5.6.0 ]
Affected platforms
- linux
- windows
- OS X
- freebsd
- solaris
- other (android on samsung galaxy tab 3)
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
If CLI, please paste the entire command below
{cli command here}
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
browserSync
.init({
server: distDir,
ghostMode: false,
reloadOnRestart: false,
port: params.port || config.browserSyncPort || 3000,
open: (typeof params.openBrowser === 'boolean') && params.openBrowser || config.openBrowser || false,
middleware: function (req, res, cb) {
// When using multiple languages, the root does not contain html files
if (hasMultipleLocales && req.url === '/') {
res.writeHead(302, { 'Location': `/${config.defaultLanguage || 'en'}/` });
res.end();
req.url = `/${config.defaultLanguage || 'en'}/`;
return;
}
if (req.url.indexOf('.') > -1) {
return cb();
}
const uri = url.parse(req.url);
if (
uri.pathname.length > 1
&& path.extname(uri.pathname) === ''
&& fs.existsSync(path.join(distDir, uri.pathname + '.html'))
) {
req.url = uri.pathname + '.html' + (uri.search || '');
}
cb();
}
});
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
browsersync does not reload when there are changes in .css
scss to .css it does not do anything. As you can see I have 2 consoles, 1 executes gulp (to compile sass) and...
Read more >Browsersync options
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >BrowserSync not refreshing - Laracasts
BrowserSync not refreshing. For some reason I can't get BrowserSync to refresh when I update my files. Upon running gulp watch the connection...
Read more >BrowserSync keeps reloading infinitely upon JavaScript ...
After many times of getting it to work, given the many different errors I've gotten (infinite reloading on browser, ignoring scss changes, ignoring...
Read more >If your iCloud or Safari bookmarks aren't syncing - Apple Support
For example, if you need to access a bookmark that you accidentally deleted or make changes in your web browser that don't update...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed in browser-sync-client@2.26.0 😃
I noticed the same thing starting with 2.24.5 also! For me, it would appear when staying on any breakpoint longer than heartbeatTimeout… Changing the timeout value indeed helped…
I find it strange that the problem didn’t occur prior to 2.24.5, actually…