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.

Browser not reloading on file event change

See original GitHub issue

Issue details

Please provide issue details here. Browser not reloading on file event change, sometimes it will but in another session it does not reload

Steps to reproduce/test case

Running Browsersync v2.23.6 with Gulp & VVV local development, browser is not reloading after file has changed, the issue is intermittent, singular body tag exists.

Issue is odd as sometimes the reload works - then it will simply stop and I am not able to get it going even with a gulp task restart, browsersync sync and browser restart.

Please provide necessary steps for reproduction of this issue, or better the reduced test case (without any external dependencies).

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

  • Browsersync [ 2.23.6 ]
  • Node [ 8.9.0 ]
  • Npm [ 5.5.1 ]

Affected platforms

  • linux
  • windows
  • [x ] OS X
  • freebsd
  • solaris
  • other (please specify which)

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 code here}

> Executing task: node_modules/.bin/gulp sync <

[10:24:44] Using gulpfile ~/remote-dev/www/mysite/htdocs/wp-content/themes/mysitetheme/gulpfile.js
[10:24:44] Starting 'sync'...
[10:24:44] Finished 'sync' after 14 ms
[Browsersync] Proxying: mysite.test
[Browsersync] Access URLs:
 -------------------------------------
       Local: http://localhost:3000
    External: http://192.168.0.11:3000
 -------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.0.11:3001
 -------------------------------------
[Browsersync] Watching files...
[Browsersync] File event [change] : style.css

Gulp task

// Fire up browserSync
gulp.task('sync', function() {
    browserSync.init({
        proxy: "mysite.test",
	files: ["./*.css","*.php","css/*css","lib/*.php", "includes/*.php", "includes-child/*.php", "includes-child/woocommerce/*.php", "includes-child/woocommerce/*.css"],
	xip: false

    });

});

Have tried… Rrestarting all the things, Check for duplicate instances of body tag Changed proxy value to localhost:3000 Resync’ing browsers from UI xip values both true and false

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
uaibocommented, Sep 12, 2019

Here’s the solution that worked for me:

browserSync.init({
  injectChanges: false
});

injectChanges is true by default: https://www.browsersync.io/docs/options#option-injectChanges

1reaction
michaelwautiercommented, Jun 28, 2020

Here’s the solution that worked for me:

browserSync.init({
  injectChanges: false
});

injectChanges is true by default: https://www.browsersync.io/docs/options#option-injectChanges

@uaibo This worked for me, thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser-sync not reloading for file event add/change
For some reason browser-sync is not triggering reloads when my image files are modified/added/removed? In the terminal its logging [BS] File ...
Read more >
Live Reloading Content during Development
Live Reload then automatically refreshes the browser after a changed file is saved to disk. The automatic refresh is the same behavior as ......
Read more >
Not reload applying code changes but browser does not refresh
I'm trying to get hot reload working in Visual Studio 2022 (17.0.1) but am ... Despite that, no changes occur in the browser...
Read more >
How do I use JavaScript to modify the URL without reloading ...
Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page.
Read more >
Location reload() Method - W3Schools
The reload() method reloads the current document. The reload() method does the same as the reload button in your browser.
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