browser-sync not compatible with node 14+ due to outdated chokidar version using outdated fsevents

Created on 21 May 2020  Â·  7Comments  Â·  Source: BrowserSync/browser-sync

Issue details

├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]

npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

Steps to reproduce/test case

  1. Install node 14+
  2. Add devDependency for [email protected]
  3. npm install to see warning

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [2.26.7]
  • Node [14.3.0]
  • Npm [6.14.5]

Affected platforms

  • [x] linux
  • [ ] windows
  • [x] macOS
  • [ ] freebsd
  • [ ] solaris
  • [ ] other _(please specify which)_

Browsersync use-case

  • [ ] API
  • [x] Gulp
  • [ ] Grunt
  • [ ] CLI

If CLI, please paste the entire command below

{cli command here}

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

{Browsersync init code here}

    const browserSync = require('browser-sync').create();
    browserSync.init({
      open: false,
      logFileChanges: false,
      proxy: `localhost:${config.port}`,
      ws: true,
      middleware: [
        webpackDevMiddleware(compiler, {
          noInfo: false,
          stats: {
            assets: true,
            cached: false,
            cachedAssets: false,
            children: false,
            colors: true,
            chunks: false,
            chunkModules: false,
            chunkOrigins: false,
            depth: false,
            env: false,
            errors: true,
            errorDetails: true,
            hash: false,
            modules: false,
            performance: true,
            reasons: false,
            timings: false, // Redundant since gulp provides timing
            warnings: false
          }
        })
      ],
      port: config.browserSyncPort,
      plugins: ['bs-fullscreen-message']
    });

    compiler.hooks.done.tap('ReloadDevices', stats => {
      if(stats.hasErrors() || stats.hasWarnings()) {
        return browserSync.sockets.emit('fullscreen:message', {
          title: 'Webpack Error:',
          body: stripAnsi(stats.toString()),
          timeout: 100000 // 100 seconds
        });
      }
      browserSync.reload();
    });

Most helpful comment

:thumbleweed:

All 7 comments

:thumbleweed:

Node.js 14 is active LTS now: https://nodejs.org/en/about/releases/
Will this issue be fixed soon?

@nstuyvesant did you find any work around this issue ?

Is this being looked into?

@smares upgrading to webpack 5 from webpack 4 fixed for me.

But what does Webpack 5 have to do with this? 🤔

@smares you are the one with the problem, I'm just giving you solution mate.
"webpack-dev-middleware": "^4.1.0",
"webpack": "^5.24.2",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  Â·  3Comments

Hurtak picture Hurtak  Â·  3Comments

zewa666 picture zewa666  Â·  3Comments

ericmorand picture ericmorand  Â·  3Comments

ronilaukkarinen picture ronilaukkarinen  Â·  4Comments