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 in an unknown command throws error #9887

Closed
jamesgeorge007 opened this issue Feb 17, 2020 · 1 comment · Fixed by #9888
Closed

Passing in an unknown command throws error #9887

jamesgeorge007 opened this issue Feb 17, 2020 · 1 comment · Fixed by #9888
Assignees
Milestone

Comments

@jamesgeorge007
Copy link
Member

jamesgeorge007 commented Feb 17, 2020

Describe the bug
With #9881 passing in an unknown command results in an error being thrown:

Invalid command: Command {
  commands: [],
  options: [],
  _execs: Set {},
  _allowUnknownOption: false,
  _args: [],
  _name: '*',
  _optionValues: {},
  _storeOptionsAsProperties: true,
  _passCommandToAction: true,
  _actionResults: [],
  _helpFlags: '-h, --help',
  _helpDescription: 'output usage information',
  _helpShortFlag: '-h',
  _helpLongFlag: '--help',
  _noHelp: true,
  _exitCallback: undefined,
  _executableFile: undefined,
  parent: [Command]
}.
 See --help for a list of available commands.
Arguments are: undefined
/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/node_modules/leven/index.js:26
	while (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {
	                                                                  ^

TypeError: right.charCodeAt is not a function
    at leven (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/node_modules/leven/index.js:26:68)
    at /home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/lib/cli/dist/generate.js:79:73
    at Array.find (<anonymous>)
    at Command.<anonymous> (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/lib/cli/dist/generate.js:79:42)
    at Command.listener (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/node_modules/commander/index.js:370:29)
    at Command.emit (events.js:203:13)
    at Command.parseArgs (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/node_modules/commander/index.js:894:12)
    at Command.parse (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/node_modules/commander/index.js:642:21)
    at Object.<anonymous> (/home/james-the-hacker/CodeSpace/GitHub-Projects/storybook/lib/cli/dist/generate.js:88:85)
    at Module._compile (internal/modules/cjs/loader.js:868:30)
@shilman
Copy link
Member

shilman commented Feb 18, 2020

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.14 containing PR #9888 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

@shilman shilman added the cli label Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants