Skip to content

SyntaxError in micromatch when starting browser-sync #1682

@mxeff

Description

@mxeff

Issue details

A SyntaxError is thrown when starting browser-sync:

[13:07:39] Finished 'build' after 20 s
[13:07:39] Starting 'server'...
[13:07:39] 'server' errored after 7.79 ms
[13:07:39] /xxx/xxx/node_modules/micromatch/index.js:44
    let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
                                                   ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/xxx/xxx/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Steps to reproduce/test case

  1. Run npm install with browser-sync@^2.10.0 as dev dependency
  2. Run gulp

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

  • Browsersync [2.26.3]
  • Node [6.12.2]
  • Npm [3.10.10]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

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

gulp.task('default',
    gulp.series(
        'build',
        server,
        watch
    )
);
function server(done) {
  'use strict';
  browser.init({
    server: PATHS.dist.base, port: PORT, open: false
  });
  done();
}

PATHS.dist.base: 'dist'
PORT: 1234

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions