Skip to content

--https- namespaced CLI commands don't seem to work. --https-key --https-cert . ] TypeError: Cannot create property 'cert' on boolean 'true' #3306

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
2 tasks done
oller opened this issue May 17, 2021 · 7 comments · Fixed by #3313

Comments

@oller
Copy link

oller commented May 17, 2021

  • Operating System: OS X
  • Node Version: 14.15.3
  • NPM Version: 6.14.9
  • webpack Version: 5
  • webpack-dev-server Version: 4.0.0.beta.3
  • Browser: Brave
  • This is a bug
  • This is a modification request

Code

Running webpack serve via the CLI with https cert options seems to error

webpack serve --https --https-cert ./.ssl/cert.pem --https-key ./.ssl/key.pem",

The above will error with:

[webpack-cli] TypeError: Cannot create property 'cert' on boolean 'true'

I tried omitting the --https as I wasn't sure if that was not necessary due to the namespced key and cert options being passed. That gets past that previous point of error in the compilation but then errors

[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property 'stats'. These properties are valid:
   object { bonjour?, client?, compress?, devMiddleware?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }

Expected Behavior

Be able to pass --https --https-key ../path --https-cert ../path options

Actual Behavior

Errors

For Bugs; How can we reproduce the behavior?

For Features; What is the motivation and/or use-case for the feature?

@snitin315
Copy link
Member

@oller don't pass --https along with other https flags, Use --https-key ../path --https-cert ../path instead.

@oller
Copy link
Author

oller commented May 17, 2021

@oller don't pass --https along with other https flags, Use --https-key ../path --https-cert ../path instead.

Hi thanks for reply, I tried that as mentioned above. I then get a different error?

Let me try again....

@snitin315
Copy link
Member

webpack serve --https-cert ./.ssl/cert.pem --https-key ./.ssl/key.pem

@oller
Copy link
Author

oller commented May 17, 2021

ah ok, the remaining errors seem related to my config. So the issue was defining https along with https-cert and https-key. With this namespacing change and that cryptic error, I imagine I won't be the only person to get a little unstuck here, not sure if there's a possibly to catch and throw a more meaningful error.

@snitin315
Copy link
Member

[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.

  • configuration has an unknown property 'stats'. These properties are valid:

It looks like you need to update your webpack config, devServer.stats was removed.

@oller
Copy link
Author

oller commented May 17, 2021

[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.

  • configuration has an unknown property 'stats'. These properties are valid:

It looks like you need to update your webpack config, devServer.stats was removed.

That's right, I'll close this issue for now then, someone can re-open it if they encounter the same issue in the future, perhaps scope for a more specific msg. Thanks for the prompt replies and help @snitin315 !

@snitin315
Copy link
Member

Let's keep it open, we should improve the error here, I will update it in the near future.

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 a pull request may close this issue.

2 participants