Problem using nextjs 15 and react-three fiber
Answered
Kümmel posted this in #help-forum
KümmelOP
i'm trying to implement some 3d animations into my nextjs project and i get this error: TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
does anyone know how to use react three fiber with nextjs 15 because i cant downgrade to next 14?
does anyone know how to use react three fiber with nextjs 15 because i cant downgrade to next 14?
Answered by Asian black bear
7 Replies
Answer
@Asian black bear https://github.com/vercel/next.js/issues/71836#issuecomment-2500168526
KümmelOP
already using this:
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
still the same error: TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
still the same error: TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
Asian black bear
Are you using the
v9.0.0-rc.1
of react-three/fiber?@Asian black bear Are you using the `v9.0.0-rc.1` of react-three/fiber?
KümmelOP
├─┬ @react-three/drei@9.119.0
│ ├─┬ @react-spring/three@9.7.5
│ │ └── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
│ └── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
├── @react-three/fiber@8.17.10 invalid: "9.0.0-rc.1" from the root project
└─┬ r3f-perf@7.2.3
└── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
no i get those errors, do i need this version?
│ ├─┬ @react-spring/three@9.7.5
│ │ └── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
│ └── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
├── @react-three/fiber@8.17.10 invalid: "9.0.0-rc.1" from the root project
└─┬ r3f-perf@7.2.3
└── @react-three/fiber@8.17.10 deduped invalid: "9.0.0-rc.1" from the root project
no i get those errors, do i need this version?
Asian black bear
That comment I linked clearly says that it works with that particular version.
And the new warnings you get are npm issues with peer dependencies which you can circumvent using
--legacy-peer-deps
.@Asian black bear And the new warnings you get are npm issues with peer dependencies which you can circumvent using `--legacy-peer-deps`.
KümmelOP
thanks mate got it fixed the problem was that i had something wrong in the devDependencies and installing things ended up with an error even with --legacy-peer-deps. sorry for messing around i'm a beginner 🙂