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
Sorry for opening this issue, but I’d like to keep it as a reference in case someone encounters this in the future.
Issue
I'm running Plasmo on WSL2 and accessing the Chrome extension from Microsoft Edge on Windows 11. However, I encountered an issue where HMR (Hot Module Replacement) kept disconnecting, showing:
🟠 WARN | [plasmo/parcel-runtime]: Connection to the HMR server is closed for /home/USER/path_to_extension/youtube.ts
In the extension page > errors section, I saw:
WebSocket connection to 'ws://localhost:1815/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
WebSocket connection to 'ws://localhost:1816/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
Troubleshooting Attempts
Changed WSL2 networking mode to Mirrored (from NAT) → Worked temporarily but the issue returned.
Disabled antivirus & firewall, added inbound rules → No effect.
Tried various AI-suggested solutions → No success.
Confirmed that it worked fine on Windows (Issue is WSL2-specific).
Simply binding the HMR and server hosts to 0.0.0.0 instead of localhost solved the issue:
pnpm dev --hmr-host=0.0.0.0 --hmr-port=1815 --serve-host=0.0.0.0 --serve-port=1012
This allows WebSocket connections from WSL2 to Windows properly.
Why does this work?
IDK to be honest, but if anyone can explain why this is the case, I would really appreciate it.
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
WebSocket connection to 'ws://localhost:1815/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
WebSocket connection to 'ws://localhost:1816/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
What happened?
Hello there,
Sorry for opening this issue, but I’d like to keep it as a reference in case someone encounters this in the future.
Issue
I'm running Plasmo on WSL2 and accessing the Chrome extension from Microsoft Edge on Windows 11. However, I encountered an issue where HMR (Hot Module Replacement) kept disconnecting, showing:
In the extension page > errors section, I saw:
Troubleshooting Attempts
Solution
After digging around, I found this [Reddit thread](https://www.reddit.com/r/bashonubuntuonwindows/comments/lvyret/comment/gpejbb3/) suggesting that WSL2 behaves as a separate machine, meaning
localhost
might not resolve as expected.Fix:
Simply binding the HMR and server hosts to
0.0.0.0
instead oflocalhost
solved the issue:This allows WebSocket connections from WSL2 to Windows properly.
Why does this work?
IDK to be honest, but if anyone can explain why this is the case, I would really appreciate it.
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
(OPTIONAL) Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: