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.

[2.26.10] YError: Invalid first argument. Expected boolean or string but received function.

See original GitHub issue

Issue details

Getting the version or just running browser-sync outputs this error:

# browser-sync --version
YError: Invalid first argument. Expected boolean or string but received function.
    at argumentTypeError (/usr/lib/node_modules/browser-sync/node_modules/yargs/build/lib/argsert.js:64:11)
    at /usr/lib/node_modules/browser-sync/node_modules/yargs/build/lib/argsert.js:45:17
    at Array.forEach (<anonymous>)
    at Object.argsert (/usr/lib/node_modules/browser-sync/node_modules/yargs/build/lib/argsert.js:38:25)
    at Object.version (/usr/lib/node_modules/browser-sync/node_modules/yargs/build/lib/yargs.js:796:19)
    at runFromCli (/usr/lib/node_modules/browser-sync/dist/bin.js:46:10)
    at Object.<anonymous> (/usr/lib/node_modules/browser-sync/dist/bin.js:38:5)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
[Function]

It doesn’t produce an exit code so my Travis-CI builds continued to push it to my repos and breaks my stack’s updater. Very bad.

Build log: https://travis-ci.org/github/demyxco/browsersync/builds/709580148

Steps to reproduce/test case

  • npm -g install browser-sync
  • browser-sync --version

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

  • Browsersync [ 2.26.10 ]
  • Node [ v12.15.0 ]
  • Npm [ 6.13.4 ]

Affected platforms

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

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • [ ✅ ] CLI

If CLI, please paste the entire command below

No issues, works fine even with that exit 0 error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
demyxcocommented, Jul 21, 2020

You all will have to downgrade since 2.26.9 is affected as well.

npm -g install browser-sync@2.26.7
7reactions
shakyShanecommented, Jul 26, 2020

Hi all, fixed as of browser-sync@2.26.12 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

My node server doesn't load the page using browsersync as a ...
Indeed, I receive the the msg from nodemon that the server is running, and from browser-sync that it is proxing my server, as...
Read more >
correctly downloaded node.js but still unable to install browser-sync ...
... in cmd it shows something like this error :YError: Invalid first argument. Expected boolean or string but received function. at argumentTypeError ...
Read more >
HAProxy 1.5 changelog
BUG/MINOR: tcpcheck: conf parsing error when no port configured on server and last rule is a CONNECT with no port - BUG/MINOR: tcpcheck:...
Read more >
rollup changelog
Fix a situation where invalid code was rendered when dynamically importing a module with synthetic named exports when preserving modules (#3738) ...
Read more >
CoffeeScript
-s, --stdio, Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT. ... boolean: if true, output without the top-level function safety...
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