You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After creating a project with vue create and then updating dependencies to use webpack v5 (see reproduction repo), and configuring webpack to use HTTPS, we start to get a warning running npm run serve that the devServer.https option is deprecated.
(node:1420683) [DEP_WEBPACK_DEV_SERVER_HTTPS] DeprecationWarning: 'https' option is deprecated. Please use the 'server' option.
The new config format is to use devServer.server like:
However, once making this change and then starting npm run serve while specifying a valid key/cert via ENV, such as:
HOST=localhost HTTPS_KEY=../.localhost/localhost+2-key.pem HTTPS_CERT=../.localhost/localhost+2.pem npm run serve
There are a few problems, the most serious being that HMR no longer works.
What is expected?
The "App running at" links should specify links with the "https" protocol
The webpack-dev-server websocket connection should attempt to connect over "wss://"
What is actually happening?
The init code in serve.js only checks for project options at devServer.https and not devServer.server.type === 'https', so while the webpack server technically works, some parts are overriden by incorrect config generated by vue/cli-service. This results in:
"App running at" links specify "http://..." instead of "https://..." and then these links don't work due to webpack not listening on "http"
The webpack-dev-server client socket is configured to connect to the incorrect protocol "ws://" instead of "wss://" which is not allowed by the browser
Version
5.0.4
Reproduction link
github.com
Environment info
Steps to reproduce
After creating a project with
vue create
and then updating dependencies to use webpack v5 (see reproduction repo), and configuring webpack to use HTTPS, we start to get a warning runningnpm run serve
that thedevServer.https
option is deprecated.The new config format is to use
devServer.server
like:However, once making this change and then starting
npm run serve
while specifying a valid key/cert via ENV, such as:There are a few problems, the most serious being that HMR no longer works.
What is expected?
What is actually happening?
The init code in
serve.js
only checks for project options atdevServer.https
and notdevServer.server.type === 'https'
, so while the webpack server technically works, some parts are overriden by incorrect config generated by vue/cli-service. This results in:Probably just need to update the check for
useHttps
in https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/commands/serve.js#L104 to fix.The text was updated successfully, but these errors were encountered: