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

(node:32144) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #1441

Closed
mforman1 opened this issue Jan 20, 2021 · 2 comments

Comments

@mforman1
Copy link

mforman1 commented Jan 20, 2021

After upgrading commander version from 6.2.1 to 7.0.0 I get the following error:

(node:32144) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

On the below line:

const cmd = require('commander')

 devServer: {
    contentBase: outputdir,
    open: true,
 ->   openPage: path.normalize(cmd.page),
    overlay: {
      errors: true
    },
    historyApiFallback: true
    // host: '0.0.0.0'
  },

Any idea on how to solve that?

@shadowspawn
Copy link
Collaborator

This is an educated guess as your program fragment does not show where cmd came from.

Try changing cmd.page to cmd.opts().page.

The default behaviour for storing options has changed. By default, option values are no longer stored as properties on the command. See the release notes and migration tips for more clues:

https://github.com/tj/commander.js/releases/tag/v7.0.0

@mforman1
Copy link
Author

That was it, thank you!

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

No branches or pull requests

2 participants