Description
All nextra versions ≥4.3.0 crash at build time when the app uses React Server Components. The error is:
TypeError: Cannot read properties of undefined (reading 'useMemoCache')
or a variant where useMemoCache is called through the wrong React dispatcher in the RSC context.
Root cause
nextra 4.3.0 introduced a dependency on react-compiler-runtime@^19.1.0-rc.2. This package calls useMemoCache via the React dispatcher — but in the RSC build pass, the dispatcher used is not the full client dispatcher, so useMemoCache is not available at the point it is called.
nextra 4.2.17 uses an older experimental compiler runtime that does not trigger this path, and builds successfully.
Reproduction
- Create a Next.js 15 app with nextra ≥4.3.0
- Run
next build
- Build crashes with a
useMemoCache error during the RSC compilation pass
Workaround
Pin to nextra@4.2.17 and nextra-theme-docs@4.2.17.
Environment
- nextra: 4.3.0–4.6.1 (all affected)
- next: 15.x
- react: 19.x
- node: 22.x
Related
Description
All nextra versions ≥4.3.0 crash at build time when the app uses React Server Components. The error is:
or a variant where
useMemoCacheis called through the wrong React dispatcher in the RSC context.Root cause
nextra 4.3.0 introduced a dependency on
react-compiler-runtime@^19.1.0-rc.2. This package callsuseMemoCachevia the React dispatcher — but in the RSC build pass, the dispatcher used is not the full client dispatcher, souseMemoCacheis not available at the point it is called.nextra 4.2.17 uses an older experimental compiler runtime that does not trigger this path, and builds successfully.
Reproduction
next builduseMemoCacheerror during the RSC compilation passWorkaround
Pin to
nextra@4.2.17andnextra-theme-docs@4.2.17.Environment
Related
useMemoCacheis not a function on Vercel with Next Canary payloadcms/payload#10369 — sameuseMemoCachesymptom in a different framework