Laravel-mix: Browsersync doesn't compile or watch files.

Created on 17 Mar 2018  路  6Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 2.1.7
  • Node Version (node -v): 9.8.0 (also tried on 8.9.4 and 8.10)
  • NPM Version (npm -v): 5.6.0
  • Yarn Version: 1.5.1
  • OS: Mac High Sierra 10.13.3

Description:

Whenever I run yarn run watch, the console says watching files and then says done. It doesn't even compile my files. Here is an image with what I'm talking about

mix

Here is my mix file.

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

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .setPublicPath('public')
   .browserSync({
       proxy: 'mix.test',
       files: [
        'public/**/*',
        'resources/views/**/*.*'
       ]
   });

Also when running yarn run watch for the first time, it doesn't install the browsersync dependencies on the first try. I have to run yarn run watch twice for the dependencies to fully download.

Steps To Reproduce:

laravel new mix
yarn install
yarn run watch ...to install the browsersync dependencies, though it makes me do this twice for some reason.
yarn run watch

Most helpful comment

Yeah, looks like there was some breaking change in browser-sync-webpack-plugin. I've tagged a new release that hardcodes the version requirement to 2.0.1 for now.

I've also fixed the issue that required two npm run watch's to install both dependencies. Both tagged in 2.1.8.

All 6 comments

I ran into the same issue today! Didn't figure out _what_ was wrong but rolling back to a previous version of Browsersync's webpack plugin seemed to work.

In your package.json file, update browser-sync-webpack-plugin to 2.0.1 and reinstall your deps.

Or you can run:

yarn add -D [email protected]

Hopefully an official fix will be released soon.

+1 for this issue. Since the new tailwind implementation requires Mix 2.0 to take example of Extends (Apparently, 1.7 didn't have that), you have to update to use that, but then it breaks watching.

Yeah, looks like there was some breaking change in browser-sync-webpack-plugin. I've tagged a new release that hardcodes the version requirement to 2.0.1 for now.

I've also fixed the issue that required two npm run watch's to install both dependencies. Both tagged in 2.1.8.

@JeffreyWay Thanks for patching this up so quickly!

Made a pull request to fix this issue, waiting to get merged.

@JeffreyWay Official plugin fix was released: 2.2.2 https://github.com/Va1/browser-sync-webpack-plugin/releases/tag/v2.2.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpriceonline picture jpriceonline  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

terion-name picture terion-name  路  3Comments

amin101 picture amin101  路  3Comments

dtheb picture dtheb  路  3Comments