question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack-dev-server - 4.0.0-beta.3 breaks secure WSS websocket connections with HMR

See original GitHub issue
  • Laravel Mix Version: 6.0.23
  • Node Version 16.3.0:
  • NPM Version 7.15.1:
  • OS: MAC OS

Description:

It seems like the upgrade to “webpack-dev-server”: “4.0.0-beta.3” has broken something with the websocket connection of the devServer. If your dev server is running in HTTPS mode the websocket connection no longer uses WSS and SSL which browsers block.

Steps To Reproduce:

It looks like this is if you are using your own key and cert with HMR. We have the below HMR options

mix.options({ hmrOptions: { host: host, port: '8443', } }) .webpackConfig({ devServer: { https: { key: path/to/key, cert: path/to/cert, }, } })

Run NPM hot, the dev server works correctly and serves the assets however the websocket client tries to connect using the insecure ws protocol which chrome does not allow as the page was loaded using HTTPS

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

9reactions
samanthamichele7commented, Jun 28, 2021

I ran into the same issue (including the cacert error message), but adding https: true to my hmrOptions fixed it for me:

.options({
    hmrOptions: {
        host: host,
        port: "8080",
        https: true
    },
})

I still have cert in my devServer.https config.

0reactions
biancarosenbaumcommented, Aug 9, 2021

@samanthamichele7 Thanks so much! Your solution saved me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack-dev-server - 4.0.0-beta.3 breaks secure WSS ...
If your dev server is running in HTTPS mode the websocket connection no longer uses WSS and SSL which browsers block. Steps To...
Read more >
Webpack dev server live reload is broken over HTTPS - GitLab
It looks like webpack is trying to create an insecure websocket connection? The dev server isn't hosted in https , so I guss...
Read more >
Proxy websockets connection within webpack-dev-server
Version 1.15.0 of the webpack-dev-server supports proxying websocket connections. Add the following to your configuration:
Read more >
webpack-dev-server | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Cortex 8.0 Front End Open Source Component July 2022
ARISING FROM, OUT OF OR IN CONNECTION WITH THE ... applicationinsights-react-js-3.0.3.tgz ... css-declaration-sorter-4.0.1.tgz.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found