Nuxt4 not responding with connect ECONNREFUSED nuxt-dev-3759.sock when using websocket on nitro
I had a working solution for proxying websockets (here) in v3, but due to the upgrade the error above now appears.
I also tried multiple different solution which don't work anymore either.
Image for clarification:
First connection successful, backend gets stopped, client tries to reconnect, fails, i refresh the page manually => nuxt not responding anymore
GitHub
feat: support runtime proxy using route rules by pi0 · Pull Reques...
🔗 Linked issue
#113
❓ Type of change
📖 Documentation (updates to the documentation or readme)
🐞 Bug fix (a non-breaking change that fixes an issue)
👌 Enhancement (improving an existing functio...

3 Replies
Hi @Joni. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, the error you’re encountering:
is a known issue that has been reported by multiple users when working with Nuxt 4, especially in development mode with Vite and Nitro. This error often appears after a failed connection attempt (such as a backend restart or a failed WebSocket reconnect), and can cause the Nuxt dev server to become unresponsive until it is restarted.
Key findings from the sources:
- This type of error (ECONNREFUSED to a
This is a known, unresolved issue in some Nuxt 4 development setups, especially when using WebSockets and Nitro. The most effective workarounds are to use Node.js, keep all dependencies up to date, and restart the dev server when it becomes unresponsive. There is no definitive fix in the knowledge sources, but maintainers are aware and have released related patches in recent updatesNuxt dev server issues ERROR [unhandledRejection] read ECONNRESET. If you have a reproducible minimal repo, consider sharing it with the Nuxt team for further investigation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
.sock
file) is frequently associated with the dev server’s internal communication, particularly when using Vite and Nitro in Nuxt 4. It can be triggered by hot module replacement (HMR), WebSocket issues, or abrupt backend disconnects. Users have reported that after such errors, the dev server may require a manual restart to recover. This is consistent with your experience of the server not responding after a failed reconnect and manual page refreshNuxt dev server issues.
- There are also related issues with HMR and WebSocket connections, especially when using alternative runtimes like Bun, or when there are mismatches in Node/Nuxt CLI versions. Some users resolved similar issues by ensuring they were using Node (not Bun), updating Node and Nuxt CLI to the latest versions, and deleting lock files and node_modules
before reinstalling dependenciesNuxt dev server issues.
- In some cases, the problem is exacerbated by the dev server being bombarded with requests (e.g., from DevTools or certain modules), or by network conditions such as VPNs or proxies. Disabling certain modules or DevTools features (like fonts) has reduced the frequency of errors for some users, but not eliminated themERROR [unhandledRejection] read ECONNRESET.
- There is no explicit, official fix for this specific scenario in the knowledge sources. However, maintainers have acknowledged the issue and indicated that fixes for related HMR and connection reset problems have been released in newer versions of Nuxt CLI and related packages. Ensuring all dependencies are up to date is recommendedERROR [unhandledRejection] read ECONNRESET.
What you can try:
1. Ensure you are using Node.js (not Bun) for development. Several users reported that Bun causes or exacerbates these issues, and switching to Node.js resolved them.
2. Update all Nuxt-related dependencies (Nuxt, Nitro, CLI, Vite) to the latest versions. Delete your lock file and node_modules
, then reinstall.
3. Check for duplicate or outdated CLI versions. Make sure the CLI version used to run the dev server matches your project’s dependencies.
4. If using custom WebSocket or proxy logic, review any breaking changes in Nitro/Nuxt 4’s WebSocket or server handling. The upgrade may have changed how sockets are managed, and previous workarounds may no longer apply.
5. If the issue persists, consider disabling or adjusting modules that may be making excessive requests, and avoid using VPNs or proxies during development to rule out network-related causes.
Summary:This is a known, unresolved issue in some Nuxt 4 development setups, especially when using WebSockets and Nitro. The most effective workarounds are to use Node.js, keep all dependencies up to date, and restart the dev server when it becomes unresponsive. There is no definitive fix in the knowledge sources, but maintainers are aware and have released related patches in recent updatesNuxt dev server issues ERROR [unhandledRejection] read ECONNRESET. If you have a reproducible minimal repo, consider sharing it with the Nuxt team for further investigation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@218732783902654465> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
I hoped it was due to the bun version, but i installed the suggested version and ran a cleaned project with npm. didnt work either.
Also I checked all other suggestions from the bots answer. I also disabled devtools since its currently an issue.