#5022·nextra

nextra ≥4.3.0 crashes in RSC context: useMemoCache called through wrong React dispatcher

Author: vu-dao-93Created Jun 29, 2026Updated Jun 29, 2026

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

  1. Create a Next.js 15 app with nextra ≥4.3.0
  2. Run next build
  3. Build crashes with a useMemoCache error during the RSC compilation pass

Workaround

Pin to [email protected] and [email protected].

Environment

  • nextra: 4.3.0–4.6.1 (all affected)
  • next: 15.x
  • react: 19.x
  • node: 22.x

Related