next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Turbopack dev: computed next/dynamic RSC loaders with client descendants fail under cacheComponents

Open dl-web-dev opened this issue 4 months ago • 0 comments

Link to the code that reproduces this issue

https://github.com/dl-web-dev/next-dynamic-rsc-factory-repro.git

To Reproduce

npm install
npm run dev

Open http://localhost:3000/demo, notice module factory error. Full hard reload of page does not trigger error.

Current vs. Expected behavior

Current behavior:

With cacheComponents: true, computed next/dynamic loaders for Server Components that render Client Component descendants cause a dev-time factory error after HMR:

Error: Module [project]/tenants/demo/provider-client.tsx [app-rsc] (client reference proxy) was instantiated because it was required from ... but the module factory is not
available.

Can get full log if necessary but it isnt very legible and can be seen in the reproduction repo.

The request can still return HTTP 200, but the server logs the factory error and Instant-validation warning.

Expected behavior:

Computed dynamic component loading should not produce missing client-reference factories during Turbopack development/HMR.

Tested Versions:

  • Next.js 16.3.0
  • Next.js 16.3.1-canary.1

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Tue Jun  9 22:26:22 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T8132
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 24.0.2
  npm: 11.3.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.3.1-canary.1 // Latest available version is detected (16.3.1-canary.1).
  eslint-config-next: N/A
  react: 19.2.8
  react-dom: 19.2.8
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Lazy Loading, Runtime, cacheComponents, Module Resolution

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

  • Regression observed between Next.js 16.2.4 (works) and 16.3.0 (fails).
  • After clearing .next and restarting, these did not resolve the module-factory error:
    • export const instant = false
    • disabling turbopackMemoryEviction
    • disabling turbopackFileSystemCacheForDev

Let me know if any additional information Is required or if something is not clear.

dl-web-dev avatar Aug 04 '26 20:08 dl-web-dev