Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getPayload node exits on webpack-hmr websocket failure #9279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanRibbens
Copy link
Contributor

What?

When a script attempts to load payload using getPayload(), it will end with: Error: connect ECONNREFUSED 127.0.0.1:3000 etc...

Why?

Even though there is a try/catch, it still errors because WebSocket connection failures happen asynchronously after the ws object is instantiated.

How?

Added the error handling function cached.ws.onerror to prevent exit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant