-
Notifications
You must be signed in to change notification settings - Fork 30k
Open
Description
Link to the code that reproduces this issue
https://github.com/mattfc-ct/react-cache-test
To Reproduce
Reproduction repo is created with npx create-next-app
- Start the dev server with
npm run devor build/start withnpm run build && npm run start - Load the homepage http://localhost:3000
- Observe the console log
Current vs. Expected behavior
Current behavior:
Note the following output:
Running cacheTest function for key uncached
Running cacheTest function for key cached
Running cacheTest function for key cached
This indicates that the React cache function is not caching when using "use cache", but it is working when uncached.
Expected behavior
The output should be:
Running cacheTest function for key uncached
Running cacheTest function for key cached
Meaning, the React cache function should cache the same way whether "use cache" is present or not.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 10
Binaries:
Node: 24.11.0
npm: 11.6.1
Yarn: 1.22.22
pnpm: 10.25.0
Relevant Packages:
next: 16.0.8 // Latest available version is detected (16.0.8).
eslint-config-next: N/A
react: 19.2.1
react-dom: 19.2.1
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
cacheComponents
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
Tested on 16.0.0 and 16.0.8 and 16.1.0-canary.16 and same behavior is observed.
Metadata
Metadata
Assignees
Labels
No labels