Skip to content

React 19 support - "Cannot read properties of undefined (reading 'ReactCurrentOwner')" #3398

Description

@AndrewRayCode

I'm not sure yet, but react-three-fiber may not be compatible with React 19. Running react-three-fiber in react@19.0.0-rc-66855b96-20241106 raises an error:

hook.js:608 TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
at $$$reconciler (react-reconciler.development.js:498:46)
at createRenderer (events-321b05fb.esm.js:223:31)
at [project]/node_modules/@react-three/fiber/dist/events-321b05fb.esm.js [app-client] (:3000/ecmascript) (http://localhost:3000/_next/static/chunks/node_modules_%40react-three_fiber_dist_9ff2d1._.js:1687:36)

I had to install @react-three/fiber with --force because react@19.0.0-rc... apparently does not satisfy the >=18

npm install --save three @types/three @react-three/fiber
npm error Could not resolve dependency:
npm error peer react@">=18.0" from @react-three/fiber@8.17.10
npm error node_modules/@react-three/fiber
npm error @react-three/fiber@"*" from the root project

This is an issue because npx create-next-app apparently uses react rc19. I tried downgrading it with

npm uninstall react react-dom
npm install react@18.2.0 react-dom@18.2.0

But same error in browser. Either way it looks like there might be reconciler(?) changes in React 19 that r3f does not currently support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions