nextjs - 💡(How to fix) Fix HMR (hot module reload) does not work if assetPrefix is set (15.5.4) [5 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#84232Fetched 2026-04-08 02:20:15
View on GitHub
Comments
5
Participants
3
Timeline
8
Reactions
1
Author
Timeline (top)
commented ×5issue_type_added ×1subscribed ×1unsubscribed ×1

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32266
  Available CPU cores: 22
Binaries:
  Node: 22.16.0
  npm: 11.6.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: N/A
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/SasSam/nextjs-hmr-assetprefix-issue

To Reproduce

Follow the guide here: https://github.com/SasSam/nextjs-hmr-assetprefix-issue/blob/main/steps.md

Current vs. Expected behavior

When I run the app with the assetPrefix set, the HRM should function properly.

If the assetPrefix is set, the websocket call (_next/webpack-hrm) is pending and its state is "stalled". This is wrong.

The expected behaviour is that the _next/webpack-hrm should return a status HTTP/1.1 101 Switching Protocols regardless of the assetPrefix setting.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32266
  Available CPU cores: 22
Binaries:
  Node: 22.16.0
  npm: 11.6.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

Follow the steps.md to set up the app and reproduce the issue. The repo has a complete env setup to run this locally.

extent analysis

TL;DR

  • Verify the assetPrefix configuration in next.config.js to ensure it's correctly set up for Hot Module Replacement (HMR) to function properly.

Guidance

  • Review the next.config.js file to confirm that the assetPrefix is correctly configured, considering the base path for assets when HMR is enabled.
  • Check the WebSocket connection (_next/webpack-hmr) in the browser's developer tools to see if there are any errors or hints about why the connection is stalled.
  • Ensure that the steps.md guide is followed precisely to reproduce the issue, as it might provide clues about the configuration or environment that's causing the problem.
  • Investigate if there are any known issues or updates in Next.js version 15.5.4 that could be related to HMR and assetPrefix.

Example

No specific code example is provided due to the lack of direct code references in the issue, but reviewing the next.config.js file for correct assetPrefix setup is crucial.

Notes

The solution might depend on the specific configuration and environment setup as described in the steps.md file. Ensuring that all steps are followed accurately can help in identifying or resolving the issue.

Recommendation

  • Apply workaround: Adjust the assetPrefix configuration according to Next.js documentation and the specific requirements of the project to see if it resolves the HMR issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix HMR (hot module reload) does not work if assetPrefix is set (15.5.4) [5 comments, 3 participants]