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

TypeError when watchOptions.ignored is not an array #1563

Closed
2 of 10 tasks
mhkeller opened this issue May 24, 2018 · 0 comments
Closed
2 of 10 tasks

TypeError when watchOptions.ignored is not an array #1563

mhkeller opened this issue May 24, 2018 · 0 comments

Comments

@mhkeller
Copy link

mhkeller commented May 24, 2018

Issue details

Per the docs, watchOptions.ignored can be any value passed to chokidar. The example shows *.txt for instance. It seems that ignored must be an array since lib/cli/transforms/copyCLIIgnoreToWatchOptions.ts called .concat on it. Indeed, if you try something like ignored: '*.txt' you'll get the error:

/path/to/node_modules/browser-sync/dist/cli/transforms/copyCLIIgnoreToWatchOptions.js:11
        return ignored.concat(userIgnore);
                       ^

TypeError: ignored.concat is not a function

Steps to reproduce/test case

Set watchOptions.ignored to '*.txt' and try to run the server.

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

  • Browsersync [2.24.4]
  • Node [8.9.0]
  • Npm [6.0.1]

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

'use strict';

module.exports = {
  server: {
    baseDir: './',
    directory: true
  },
  watchOptions: {
    ignoreInitial: true,
    ignored: new RegExp('\\.map$')
  },
  port: 8000,
  ui: {
    port: 3000
  },
  ghostMode: false,
  files: 'public/**/*',
  startPath: '/public/index.html',
  reloadDebounce: 750,
  notify: false,
  open: false,
  reloadOnRestart: true,
  logLevel: 'silent'
};
var bsConfig = require('./config.js');
bs.init(bsConfig);
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

1 participant