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

Passing --domain crashes app if another known option is passed after it #1

Closed
specious opened this issue Nov 6, 2015 · 1 comment
Closed
Labels

Comments

@specious
Copy link
Owner

specious commented Nov 6, 2015

Node crashes with TypeError: domain.enter is not a function when a recognized option is passed after --domain but not also before it. For example:

$ bitly-client --version
1.4.0

$ bitly-client --domain j.mp --version
events.js:157
    domain.enter();
           ^

TypeError: domain.enter is not a function
    at Command.emit (events.js:157:12)
    at Command.parseOptions (/usr/local/lib/node_modules/bitly-client/node_modules/commander/index.js:702:14)
    at Command.parse (/usr/local/lib/node_modules/bitly-client/node_modules/commander/index.js:455:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/bitly-client/index.js:85:4)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)

It does not crash if only unrecognized options are passed after --domain:

$ bitly-client --version --domain j.mp --who --knows
1.4.0

It does not crash if a recognized option is passed before and after --domain:

$ bitly-client --version --domain j.mp --who --knows --version
1.4.0

This appears to be a known issue upstream ( tj/commander.js#404 ) and will presumably be fixed in commander@3.0.

@specious specious added the bug label Nov 29, 2016
@specious
Copy link
Owner Author

Solved in v1.5.5 by using @bySabi's safe-commander wrapper to parse the command line options.

See: c719a59

I'm watching tj/commander.js#404 to be in the know when this is properly resolved upstream.

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

No branches or pull requests

1 participant