Regression in canary / 15.2 breaks libraries pre-compiled with React Compiler, it works fine in 15.1 #74826
Labels
bug
Issue was opened via the bug report template.
Module Resolution
Module resolution (CJS / ESM, module resolving).
Link to the code that reproduces this issue
https://github.com/sanity-io/use-memo-cache-repro
To Reproduce
Fails with an error:
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: w.H.useMemoCache is not a function at c (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:68:4306) at /.next/server/app/page.js:1:25800 at eC (/.next/server/app/page.js:1:27452) at nO (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:45681) at nj (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:47456) at nN (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:65255) at nI (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62886) at nA (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:46033) at nj (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:47502) at nj (/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62237)
pnpm dev
logs a similar error:But is able to recover and client render. It seems to skip hydration when this happens.
Current vs. Expected behavior
The issue only happens if using
canary
ofnext
. Downgrading to15.1
works, but is a deal breaker for customers at Sanity that want to use PPR as it requires canary.Here's 15.1 deployed to vercel working just fine: https://use-memo-cache-repro-git-downgrade.sanity.dev/
Provide environment information
Node.js v20.18.1 Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.2.0: Fri Dec 6 19:03:40 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 Available memory (MB): 131072 Available CPU cores: 16 Binaries: Node: 20.18.1 npm: 10.8.2 Yarn: N/A pnpm: 9.15.3 Relevant Packages: next: 15.2.0-canary.6 // Latest available version is detected (15.2.0-canary.6). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.7.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Module Resolution
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
The repro uses
react-rx
to demonstrate the problem.The impact atm is all of Sanity's packages that uses React Compiler:
sanity
@sanity/visual-editing
react-rx
@sanity/ui
@portabletext/editor
The text was updated successfully, but these errors were encountered: