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 HMR with full assetPrefix URLs #65491

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

Conversation

kane-c
Copy link

@kane-c kane-c commented May 8, 2024

We have a Next.js server running on a different host from the client-facing app. We set assetPrefix accordingly (e.g. http://localhost:3000) which works fine, except for HMR, which has the following error repeating in the console:

WebSocket connection to http://localhost:3000/_next/webpack-hmr failed:

With no further detail.

This works fine in Next.js 13.5 but breaks in 14.x.

This patch generates the correct URL for the HMR endpoint when assetPrefix is a full http/https URL.

@ijjk
Copy link
Member

ijjk commented May 8, 2024

Allow CI Workflow Run

  • approve CI run for commit: 9d13afe

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

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.

None yet

2 participants