Firefox Hot-reload not working

I’m getting this error in the Firefox console (120.0.1 (64-bit) :

“Firefox can’t establish a connection to the server at wss://192.168.0.110:1107/. client.ts:77:17”
``` const socket = new WebSocket(`${protocol}://${hostAndPath}, ‘vite-hmr’)

Hot-reload works in other browsers such as Edge

I've tried disabling all of my extensions and have tried on other PCs

[Original Post on Discord](https://discord.com/channels/717429793926283276/1185953657074745364)

*by user 285903863339548673*

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment…

Here is what I found for you :brain: Discord

The error message suggests that Firefox is unable to establish a WebSocket connection to the provided URL. Since you mentioned that hot-reload works on other browsers such as Edge, there could be a specific issue related to Firefox or its settings.

Here are some steps to troubleshoot the issue:

  1. Check if Firefox is configured to block WebSocket connections or if there are any network settings in Firefox that may prevent it from connecting to the local server.
  2. Ensure that your firewall or antivirus software on your PC is not blocking WebSocket connections specifically for Firefox.
  3. Ensure that the WebSocket server at 192.168.0.110:1107 is correctly configured and running, and it’s not restricted to a specific set of browsers.
  4. Try temporarily creating a new Firefox profile or running Firefox in Troubleshoot Mode (formerly known as Safe Mode) to see if the problem persists. This can help determine if the problem is related to a profile issue.
  5. Check if there are any known issues with the Firefox version you are using that might affect WebSocket connections.

Additionally, you might want to verify that the WebSocket server is correctly using the right protocol (wss:// for secure connections) and that any necessary SSL certificates are valid and properly set up if it is using wss. If you’re using wss for a local development server without a valid SSL certificate, Firefox may block the connection due to security concerns.

Remember to only test and adjust settings that you are familiar with and have the rights to change. If you need further assistance, ensure you have permission to change network or software settings before proceeding.

1 messages left GPT 4
thread_XAHy00xwaDMmFb5RptHLd0zU

Hey @BOTBOT you may want to check Testing on local devices | Needle Engine Documentation – you may be running into a case where Firefox doesn’t trust the self-signed certificate enough. That link contains info on how to set up a fully trusted certificate, something that is also required for hot reload on some iOS devices

Hi @herbst🌵, just got around to trying that.

Firefox still asks me if I trust the connection. When checking the certificate, the organisation is: “mkcert development certificate”, which sounds like the new set up has been applied correctly. Hot reloading still doesn’t work as well.

I’ll be using Edge for now!

by user 285903863339548673

Thanks for the update! After some more research I think Firefox may have a separate place to set root certificates and doesn’t use the system cert store;
found this page where there are special instructions for Firefox too:

So at the moment there is no longer a ‘trust this connection’ issue and hot-reloading now works when making changes in Unity and VScode!

The fully trusted certificate fix seems to be good enough now. Maybe there was a Windows update or something

by user 285903863339548673

Great, thanks!