-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Description
Link to the code that reproduces this issue
https://github.com/rikbrown/nextjs-use-cache-in-iframe-hmr
To Reproduce
- Start the application in dev mode, go directly to URL.
- Make changes in the
CacheComponentcomponent inpage.tsx, observe HMR. - Now go to the page in an iFrame (either a local html file or remote - I put one in the repo)
- Make changes, observe no HMR
- HARD refresh, observe updated value,
- Make changes, observe no HMR.
Current vs. Expected behavior
HMR should occur without needing a hard refresh.
Provide environment information
bun next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:48:41 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6041
Available memory (MB): 131072
Available CPU cores: 16
Binaries:
Node: 22.18.0
npm: 10.9.3
Yarn: 1.22.22
pnpm: 10.28.2
Relevant Packages:
next: 16.2.0-canary.50 // Latest available version is detected (16.2.0-canary.50).
eslint-config-next: N/A
react: 19.2.3
react-dom: 19.2.3
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Use Cache
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Tested on latest stable and canary.
Tested w/ "allow third party cookies off".
Verified if I manually disable caches in the chrome dev tools, HMR does work.
The crazy thing to me is if I then open the iFrame in a totally different browser, it is still out of date. But opening the exact same URL, just not in an iframe, is up to date. This is beyond my comprehension of how Next.js caches things.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels