-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Description
Link to the code that reproduces this issue
https://github.com/guoxinghuang/next-intl-hmr-repro
To Reproduce
- Clone the repo and
pnpm install - Run
pnpm dev(uses Turbopack by default in 16.2) - Open
http://localhost:3000 - Edit
messages/en.json(e.g., change"Hello World"to"Hello Next.js") - Observe: the page does not update — a full server restart is required
Current vs. Expected behavior
Current (16.2.0): Editing a JSON translation file loaded via await import(../../messages/${locale}.json) does not trigger HMR. The dev server shows no recompilation. A full restart is required to see changes.
Expected (worked in 16.1.x): Editing the same JSON file triggered HMR and the page updated automatically without a restart.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin 25.3.0
Binaries:
Node: 22.x
pnpm: 10.28.0
Relevant Packages:
next: 16.2.0
react: 19.2.4
react-dom: 19.2.4
next-intl: 4.8.3
Which area(s) are affected?
Turbopack, HMR
Which stage(s) are affected?
next dev (development)
Additional context
This is a regression from 16.1.x → 16.2.0. JSON translation file HMR worked correctly in 16.1.
The 16.2 Turbopack release introduced two changes that may be related:
-
Server Fast Refresh — changed from clearing the full
require.cacheimport chain to only reloading the actually-changed module. Dynamicimport()with template literal paths may not be tracked as a dependency, so dependents are not invalidated when the JSON file changes. -
Tree Shaking of Dynamic Imports — Turbopack now tree-shakes destructured dynamic imports. This could affect how dynamic JSON imports are tracked in the module graph.
Downgrading to 16.1.x restores the expected HMR behavior.