Skip to content

Fixed commander API bug with this.opts() #151

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

Closed
wants to merge 1 commit into from

Conversation

jordaaash
Copy link

[...]/node_modules/react-native-webpack-server/bin/rnws.js:126
    const opts = options.opts();
                         ^

TypeError: options.opts is not a function

The correct Commander method for getting the options passed is this.opts(). This means that rwns bundle has not been functioning correctly when called with options since 14eecdf

@philikon
Copy link
Collaborator

philikon commented Jan 2, 2016

Thanks for the PR!

This means that rwns bundle has not been functioning correctly when called with options since 14eecdf

Weird, that's not what I've been seeing. All options seem to work just fine here. In fact, reading the commander code at https://github.com/tj/commander.js/blob/272e22ffa8f7dea42ebc831bd4ad900ae893a17a/index.js#L292-L301, it seems that this.opts() and options.opts() should be equivalent, because the action callback will always be called with self as this and as the last (and in our case only) argument.

Can you provide detailed steps to reproduce (environment, exact version numbers, etc.) on how you got the above error?

@jordaaash
Copy link
Author

You know what, this was due to running the bin via node (using the debugger while testing), which screwed up the options passed to the bundle command. Closing this.

@jordaaash jordaaash closed this Jan 2, 2016
@jordaaash jordaaash deleted the patch-1 branch January 2, 2016 08:11
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

Successfully merging this pull request may close these issues.

2 participants