Skip to content

Turbopack HMR - Error: Could not find the module X in the React Client Manifest #85883

@AlessioGr

Description

@AlessioGr

Link to the code that reproduces this issue

https://github.com/AlessioGr/next-16-repro

To Reproduce

  1. clone https://github.com/AlessioGr/next-16-repro
  2. pnpm i
  3. pnpm dev
  4. open http://localhost:3000/page1
  5. go to src/app/page2/page.tsx and type. This will trigger HMR
  6. keep triggering HMR until you get the error

Current vs. Expected behavior

In Payload CMS, we listen to the HMR websocket in order to reload the payload config when changes happen.

After upgrading from Next.js 15.4.x → 16 (and starting in 15.5.0), HMR in dev frequently fails with:

  Error: Could not find the module "[project]/src/Component.tsx#Component" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
    at stringify (<anonymous>) {
  digest: '3482605753'
}

Affected setup

All of the following tend to be present when the issue reproduces:

  • Build tool: Turbopack (does not reproduce with Webpack / --no-turbo)
  • Next.js: 16.0.x (also 15.5.x)
  • A 'use client' component passed from a (non-async) page (page1) into an RSC
  • The page renders an <iframe> that loads another page (page2)
  • Both page1 and page2 have HMR listeners
  • page1 is open. Due to the iframe, this means that both hmr listeners are actively running at the same time
  • The HMR listener performs an async action on its subsequent invocation after HMR fires

In our case (Payload CMS live preview) the admin and frontend each create their own HMR subscriptions. When both are active, HMR frequently floods the server console with the manifest error above.

The problem began in Next.js 15.5.0 and persists in 16.0.x.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 24.0.1
  npm: 10.9.0
  Yarn: 1.22.22
  pnpm: 10.11.0
Relevant Packages:
  next: 16.0.2-canary.9 // Latest available version is detected (16.0.2-canary.9).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

Turbopack

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

next dev (local)

Additional context

Original issue report in Payload with analysis: payloadcms/payload#14419

First attempt to fix it from our side: payloadcms/payload#14502

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions