Skip to content

Importing react-dom in global-error makes app uninteractive #85730

@lfbergee

Description

@lfbergee

Link to the code that reproduces this issue

https://github.com/lfbergee/next16-bug

To Reproduce

In provided repo:

  1. Start application with npm run dev
  2. Click the button, it is unresponsive

// remove toast import from global-error.tsx and the app is responsive

To reproduce in any next 16 repo

  1. In global-error.tsx import a component that uses react-dom

Current vs. Expected behavior

In Next 15 you could import a component that imports react-dom in global-error.tsx.

In Next 16 that same import result in a app where React no longer has interactive click handlers.

Expected either Next to just work, like it did in Next 15, or that it breaks with an error message. Now it interactivity is just silently lost.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:45 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 24.10.0
  npm: 11.6.1
  Yarn: 1.22.21
  pnpm: 8.14.0
Relevant Packages:
  next: 16.0.2-canary.5 // Latest available version is detected (16.0.2-canary.5).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

React

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

next dev (local)

Additional context

I expect the issue is that react-dom is imported from the component is a different version than the one Next ships with, so I end up with multiple versions of react-dom in the tree, rendering the app unusable.

Importing the toast inside of page works, as I expect Next picking its internal react-dom version in that case. So it seems like this breaks only with global error. It may be that it breaks in Next 15 if that were to ship a different react-dom version than supplied by pkg.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ReactRelated to React.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions