Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locally hosted HTTPS site gives Chrome error about a websocket (when using ParcelJS bundles)

I am not using Web Sockets on this web page , but -

I am trying to understand why Chrome console prints the following "error" (I use quotes because it does not effect anything). The error only appears when I host on a HTTPS site, not HTTP (the same IIS server which is local to my computer is being used).

(and there is a valid TLS/SSL certificate)m, I have no idea why port 61396 is being looked at..

hmr-runtime.js:29 WebSocket connection to 'wss://ysg4206.draper.com:61396/' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR
parcelRequire.../../../node_modules/parcel-bundler/src/builtins/hmr-runtime.js @ hmr-runtime.js:29
like image 206
Dr.YSG Avatar asked Nov 23 '25 02:11

Dr.YSG


1 Answers

From https://parceljs.org/hmr.html

Hot Module Replacement (HMR) improves the development experience by automatically updating modules in the browser at runtime without needing a whole page refresh. This means that application state can be retained as you change small things. Parcel's HMR implementation supports both JavaScript and CSS assets.

and for that it uses WebSockets.

You can do three things:

  1. To make it go away just disable hmr: parcel entry.js --no-hmr

  2. To use HMR you can run your solution as non-https site or ...

  3. You can generate self-signed certificate and use it with IIS as well as parcel:

    parcel entry.js --cert certificate.cert --key private.key

It's all here: https://parceljs.org/cli.html

like image 104
Artur Kędzior Avatar answered Nov 26 '25 23:11

Artur Kędzior



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!