question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browsersync reload in a loop

See original GitHub issue

Hi

Issue details

For some time I have a problems with Browsersync. I have a web front-end workflow with Gulp, Browsersync, SASS and Nunjucks. Gulp compile my Nunjucks files. At the end of this task, browser is reloaded with Browsersync. Before a few days browsersync reloaded browser just once. Now it reload browser as many times as there are nunjucks files.

Please specify which version of Browsersync, node and npm you’re running

  • Browsersync [ 2.13.0 ]
  • Node [ 6.9.1 ]
  • Npm [ 4.0.2 ]

Affected platforms

  • windows

Browsersync use-case

  • Gulp
gulp.task('njk', function () {
    return gulp.src(templatesInput)
        .pipe(nunjucksRender({
            path: templatesFolder,
            ext:  '.html'
        }))
        .pipe(gulp.dest(templatesOutput))
        .pipe(browserSync.stream());
});

gulp.task('serve', function () {
    browserSync.init({
        server: {
            baseDir: render
        }
    });
    // Watch Sass
    gulp.watch(scssInput, ['css']).on('change', function (event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });

     // Watch nunjuck
    gulp.watch(templatesInput, ['njk']).on('change', function (event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });
});

gulp.task('default', ['serve', 'css', 'njk']);

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
giovannipdscommented, Jun 22, 2017

I may be on the same bug with Laravel 5.4 / Laravel Mix. =S

Related to #439 and #981?

2reactions
strarsiscommented, Jan 20, 2021

Any plans to fix this in the near future? Just ran into that bug again in 2021.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browsersync page refresh loop - sage - Roots Discourse
BrowserSync keeps reloading infinitely upon JavaScript changes. Infinite reload on Javascript Changes (Docker environment - boilerplate ...
Read more >
Browsersync keeps reloading - Stack Overflow
Browsersync has a log that you can inspect to see which files are being changed that trigger the reload. You can also increase...
Read more >
Browsersync options
Reload each browser when Browsersync is restarted. // don't auto-reload all browsers following a Browsersync reload ...
Read more >
How to configure and Set Up Gulp Browser-sync - eduCBA
The BrowserSync is utilized to observe all HTML and CSS documents in the CSS catalog and plays out the life reload to the...
Read more >
Getting Browsersync running with Gulp 4 and Valet
Set the username and site name variables, choose either http v https for the browser reload and update any paths you need watched....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found