Skip to content

Next.js 15 + React 19 breaks with “Cannot get 'react/jsx-dev-runtime'” and Invalid Hook Call errors #3828

@tastypurgen

Description

@tastypurgen

Describe the bug

After upgrading a working project (and the official nextjs-ssr example) from Next.js 14 ↠ 15 and React 18 ↠ 19, the app fails to boot:

⨯ Error: Cannot get 'react/jsx-dev-runtime'
^in terminal

Image
^in console

Reproduction:
The issue can be reproduced in the app from the examples repo:
https://github.com/module-federation/module-federation-examples/tree/master/nextjs-ssr
With the latest dependencies:

  "dependencies": {
    "@module-federation/nextjs-mf": "8.8.31",
    "lodash": "4.17.21",
    "next": "^15.3.3",
    "react": "^19.1.0",
    "react-dom": "^19.1.0",
    "webpack": "5.96.1"
  }

Reproduction

https://github.com/module-federation/module-federation-examples/tree/master/nextjs-ssr

Used Package Manager

pnpm

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 5.12 GB / 31.69 GB
  Binaries:
    Node: 20.19.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 11.4.1 - ~\AppData\Roaming\npm\npm.CMD
    pnpm: 10.12.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.146)
    Internet Explorer: 11.0.26100.1882

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions