Search code examples
laravelwebpackbrowser-synclaravel-mix

Laravel Mix + BrowserSync infinite loading out of the box


Something's making my out-of-the-box Laravel project with browser-sync and the browser-sync-webpack-plugin installed to load infinitely on the browser-sync page. It works fine on http://localhost, but the browser-sync (localhost:3000) version doesn't stop loading and displays no content, just a white page.

I found this question which was similar to mine but it doesn't have any answers.

This only recently started happening on my machine. At first I thought it was because of the antivirus or firewall but disabling them did no good. I can't even figure out what's causing the page to never load.

Here's what my webpack.mix.js file looks like:

mix.js('resources/assets/js/script.js', 'public/js')
.sass('resources/assets/sass/main.scss', 'public/css')
.disableNotifications()
.browserSync();

Edit: Any tips on narrowing down the problem would also be appreciated.

Infinite loading


Solution

  • For me, the problem was adding to the windows hosts file whatever url browsersync was proxying to, and point it to 127.0.0.1.