question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error('no parsers registered for: "' + self.input.slice(0, 5) + '"')

See original GitHub issue

After updating to 2.26.3 Browsersync is throwing an error when used with webpack and webpack-dev-server:

[Browsersync] Watching files...
.../node_modules/snapdragon/lib/parser.js:473
        throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"');
        ^

Error: no parsers registered for: "]a(r)"
    at parse (.../node_modules/snapdragon/lib/parser.js:473:15)
    at Parser.parse (.../node_modules/snapdragon/lib/parser.js:477:24)
    at Snapdragon.parse (.../node_modules/snapdragon/index.js:122:28)
    at Snapdragon.<anonymous> (.../node_modules/braces/lib/braces.js:40:45)
    at Braces.parse (.../node_modules/braces/lib/braces.js:66:26)
    at Braces.expand (.../node_modules/braces/lib/braces.js:87:18)
    at create (.../node_modules/braces/index.js:142:15)
    at memoize (.../node_modules/braces/index.js:298:13)
    at Function.braces.create (.../node_modules/braces/index.js:165:10)
    at Function.braces.expand (.../node_modules/braces/index.js:81:17)
    at getDirParts (.../node_modules/chokidar/index.js:435:31)
    at FSWatcher.<anonymous> (.../node_modules/chokidar/index.js:452:24)
    at .../node_modules/readdirp/readdirp.js:220:72
    at Array.filter (<anonymous>)
    at.../node_modules/readdirp/readdirp.js:220:12
    at .../node_modules/readdirp/readdirp.js:193:38
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spiral@0.6.1 hmr: `webpack-dev-server --env development --config resources/assets/webpack/config.base.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spiral@0.6.1 hmr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The npm debug log is this:

0 info it worked if it ends with ok
1 verbose cli [ '/home/yahzee/.nvm/versions/node/v10.9.0/bin/node',
1 verbose cli   '/home/yahzee/.nvm/versions/node/v10.9.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'hmr' ]
2 info using npm@6.4.1
3 info using node@v10.9.0
4 verbose run-script [ 'prehmr', 'hmr', 'posthmr' ]
5 info lifecycle spiral@0.6.1~prehmr: spiral@0.6.1
6 info lifecycle spiral@0.6.1~hmr: spiral@0.6.1
7 verbose lifecycle spiral@0.6.1~hmr: unsafe-perm in lifecycle true
8 verbose lifecycle spiral@0.6.1~hmr: PATH: /home/yahzee/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/d/Sites/moviefy/node_modules/.bin:/home/yahzee/bin:/home/yahzee/.local/bin:$9 verbose lifecycle spiral@0.6.1~hmr: CWD: /mnt/d/Sites/moviefy
10 silly lifecycle spiral@0.6.1~hmr: Args: [ '-c',
10 silly lifecycle   'webpack-dev-server --env development --config resources/assets/webpack/config.base.js' ]
11 silly lifecycle spiral@0.6.1~hmr: Returned: code: 1  signal: null
12 info lifecycle spiral@0.6.1~hmr: Failed to exec hmr script
13 verbose stack Error: spiral@0.6.1 hmr: `webpack-dev-server --env development --config resources/assets/webpack/config.base.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/yahzee/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/home/yahzee/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:961:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
14 verbose pkgid spiral@0.6.1
15 verbose cwd /mnt/d/Sites/moviefy
16 verbose Linux 4.4.0-17763-Microsoft
17 verbose argv "/home/yahzee/.nvm/versions/node/v10.9.0/bin/node" "/home/yahzee/.nvm/versions/node/v10.9.0/bin/npm" "run" "hmr"
18 verbose node v10.9.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error spiral@0.6.1 hmr: `webpack-dev-server --env development --config resources/assets/webpack/config.base.js`
22 error Exit status 1
23 error Failed at the spiral@0.6.1 hmr script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I tried installing previous versions and 2.25.0 works fine. Version 2.26 “works” if I remove the files option, but then of course Browsersync won’t watch for changes at all.

The relevant part of my webpack config file is this:

devServer: {
    hot: true,
    overlay: true,
    stats: 'errors-only'
  },

  plugins: [
    new BrowserSyncPlugin(
      {
        host: process.env.BS_HOST,,
        port: process.env.BS_PORT,
        proxy: process.env.BS_PROXY,
        files: [
          {
            match: [
              '**/*.blade.php'
            ],
            fn (event, file) {
              if (event === 'change') {
                const bs = require('browser-sync').get('bs-webpack-plugin')
                bs.reload()
              }
            }
          }
        ],
        open: false
      },
      {
        reload: false
      }
    ),

    new webpack.HotModuleReplacementPlugin(),

    new webpack.NamedModulesPlugin()
  ]
  • Browsersync [2.26.0]
  • Node [10.9.0]
  • Npm [6.4.1]
  • WSL on Windows 10

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:17

github_iconTop GitHub Comments

6reactions
WhereJulycommented, Mar 16, 2019

Yeah its basically because it has too much files to handle or cannot parse some of the files. If I specify only few files it works properly.

I experienced the bug when my Browsersync configuration files array allowed for watching the dir where Composer’s vendor folder was present. Thanks to the comment above I changed files array to exclude vendor folder and left there only folders that I really need BS to watch. No bug anymore.

4reactions
juslintekcommented, Feb 14, 2019

Yeah its basically because it has too much files to handle or cannot parse some of the files. If I specify only few files it works properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

throw new Error('no parsers registered for: "' + self.input.slice(0 ...
I'm on Kali Linux 2019.1, and here's my modules and scripts "scripts": { "build-task:scss-compile": "node-sass-chokidar --source-map true ...
Read more >
schrodinger.application.desmond.packages.cui module ...
Register an input file for jobcontrol to transfer. ... or when there is another parsing errors which interrupts the execution of the command,...
Read more >
uglify-js - npm
UglifyJS is a JavaScript parser, minifier, compressor and beautifier ... If no input file is specified, UglifyJS will read from STDIN.
Read more >
Top 5 acorn Code Examples - Snyk
Learn more about how to use acorn, based on acorn code examples created from ... (/.test(this.input.slice(this.pos)) ); } function dynamicImport(Parser) {.
Read more >
kivy.lang.parser — Kivy 2.1.0 documentation
Source code for kivy.lang.parser. ''' Parser ====== Class used for the parsing of .kv files into rules. ''' import os import re import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found