-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BrowserSync not refreshing pages on file change #1978
Comments
I may be experiencing the same issue. I started up a new project today with a locked version of # working state (for reloads, UI errors on Angluar issues)
npm i -D [email protected] [email protected] [email protected]
# broken
npm i -D [email protected] [email protected] [email protected] The
|
Continued digging. Found that when running the newer modules I needed to add proxy: {
target: `${protocol}://localhost:${SERVER__PORT}`,
ws: true,
},
+ serveStatic: ['./dist/public'], Best guess is that while reloading it some how was losing reference to local assets to load during a reload? Now I'm trying to figure out why when I specify ports, does browser-sync add one to the UI port. port: 3001,
ui: { port: 3002 },
// results in
// -----------------------------------
// Local: http://localhost:3001
// -----------------------------------
// UI: http://localhost:3003
// ----------------------------------- |
Turns out the random port increment was because of When
When I set
Perhaps there's been a regression due to the socket.io update, or there's now a race-condition that has the ports being assigned before the check for the UI's port. |
Ok, so these are the resulting changes that got reloads, websockets, and ports behaving for me (Current Connections in the UI is still blank, but can live with out it): {
files: [
'dist/public/manifest.json',
],
ghostMode: false,
https: bSyncHTTPS,
notify: false,
open: false,
port: SERVER__PORT + 1,
proxy: {
target: `${protocol}://localhost:${SERVER__PORT}`,
ws: true,
},
- reloadDebounce: 300,
+ reloadDebounce: 1000,
snippetOptions: {
rule: {
match: /<\/body>/i,
fn: (snippet) => snippet,
},
},
+ socket: {
+ domain: `localhost:${SERVER__PORT + 3}`,
+ port: SERVER__PORT + 3,
+ },
ui: {
port: SERVER__PORT + 2,
},
watchOptions: chokidarOpts,
} The |
It ended up being a thing: BrowserSync/browser-sync#1978
Issue details
Terminal says
[Browsersync] File event [change] : ../template-parts/blocks/overlapping-columns/overlapping-columns.css
But browser are not refreshing.
Steps to reproduce/test case
Configuration is in a package.json scripts:
"dev:bs": "browser-sync start --proxy 'myserver.com/subdir/' --files '../**/*.css, ../**/*.php, ../../../lib/**/*.php, ./dist/*js, ./product-list/dist/*js'"
It properly refreshes when css files in other directories change. But in this case it does not, even if, as you can see above, it is detecting the changes
Please specify which version of Browsersync, node and npm you're running
Affected platforms
Browsersync use-case
If CLI, please paste the entire command below
browser-sync start --proxy 'myserver.com/subdir/' --files '../**/*.css, ../**/*.php, ../../../lib/**/*.php, ./dist/*js, ./product-list/dist/*js'
The text was updated successfully, but these errors were encountered: