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-sync does not refresh browser

See original GitHub issue

Where to find the issue

cwa-website

Describe the issue

This is a testing issue only. It does not affect the production website.

When making source changes to cwa-website, browser-sync announces “Reloading Browsers”, however it does not refresh the browser contents as it should.

Steps to reproduce

Execute

npm start

Terminal shows

[Browsersync] Serving files from: ./public
Finished 'server' after xx ms
Starting 'watch'...
Finished 'watch' after xx ms
Finished 'start-server' after xxx ms
Finished 'default' after xx s

Web browser displays http://localhost:8000/en/

Open src/data/index.json in an editor. Make a change, such as changing the title in line 5 and save the change.

Starting 'resetPages'...
Finished 'resetPages' after xx ms
Finished 'pages' after x.x s
[Browsersync] Reloading Browsers...

Note that browser contents have not changed. Press F5 (refresh) in browser Now the changes which were made are displayed.

Expectation

When browser-sync displays “Reloading Browsers…” then the contents of the browser should be refreshed.

This is documented in README - Start server as:

“The web server uses public as its base directory. It also watches for file changes and refreshes the browser contents if necessary.”

It is also a documented function of Browsersync.

Synchronized scrolling between multiple browsers also does not work for cwa-website as documented in the Browsersync documentation.

Workaround

To refresh the page after making a change to the source, press F5 (refresh) in the browser window.

If there is no solution to this issue, then this hint should be added to the README - Start server section.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dsarkarcommented, Dec 29, 2021

@MikeMcC399 Thanks for the wishes! Hope you had/are having also some nice happy Christmas time!

Thanks for the PR!

1reaction
MikeMcC399commented, Dec 22, 2021

I am trying to find out the reason for this not working, but I don’t know if I will get to the bottom of it.

It works with a simple test page, so there is something about the complexity of the cwa-website which is causing a problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not refreshing the browser! · Issue #1276 - GitHub
browsersync is detecting the file change but does not refresh the browser. I am running it on Linux 4.4.0-57-generic.
Read more >
browser-sync does not refresh page after changes with Gulp
this is the simplest possible answer and it still works out of the box with the latest stable browser-sync. – Mario. Jun 26,...
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 options
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >
Using Browser-Sync to live refresh Server Side HTML and ...
Unfortunately the same cannot be said for server side code. When making changes to script pages in Web Connection I make a change, ......
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