Skip to content
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

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

Closed
3 of 10 tasks
nstuyvesant opened this issue May 21, 2020 · 8 comments

Comments

@nstuyvesant
Copy link

Issue details

├─┬ browser-sync@2.26.7
│ └─┬ chokidar@2.1.8
│ └── fsevents@1.2.13

npm WARN deprecated fsevents@1.2.13: 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 browser-sync@2.26.7
  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

  • linux
  • windows
  • macOS
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • 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();
    });
@pronebird
Copy link

:thumbleweed:

@jimmy-liao-gogoro
Copy link

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

@pikitgb
Copy link

pikitgb commented Feb 8, 2021

@nstuyvesant did you find any work around this issue ?

@smares
Copy link

smares commented Feb 27, 2021

Is this being looked into?

@pikitgb
Copy link

pikitgb commented Feb 28, 2021

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

@smares
Copy link

smares commented Feb 28, 2021

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

@pikitgb
Copy link

pikitgb commented Mar 1, 2021

@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",

@agams92
Copy link

agams92 commented Aug 6, 2021

Actually browser-sync version 2.27.* finally has that fixed, so the issue can be closed. It now uses chokidar ^3.5.1, which uses fsevents ~2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants