dhrubanka's avatar

LARAVEL mix BrowserSync not refreshing on a certain Tab

I am using laravel 8, trying to use BrowserSync. The feature is working in all the Routes except a certain route. Can't figure out why its not refreshing in '/forum' route. Here is my webpack.mix.js file:

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .sourceMaps()
    .browserSync('127.0.0.1:8000/');

I am running php artisan serve and then npm run watch. It's working on certain routes but on a certain route.

0 likes
10 replies
Sinnbeck's avatar

Is there anything in the browser console ?

Sinnbeck's avatar

@dhrubanka And the ful url is 127.0.0.1:8000/forum ?

Does this route contain a different layout than other poges?

1 like
dhrubanka's avatar

@Sinnbeck Yes sir, but I am also using asset() on other layouts where browsersync is working

dhrubanka's avatar

@SilenceBringer yes, I know very little of laravel mix. Is it mandatory to have all files compile down into app.css/app.js?

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@dhrubanka Isnt app.js used on the page? I believe that the code for browser sync is embedded inside it

dhrubanka's avatar

@Sinnbeck Okay I got to know the issue. The Browsersync was watching the layout file that is using app.js/app.css. However, The forum is using a different layout and is not compiled down using MIX and hence browsersync was not refreshing.

Please or to participate in this conversation.