Closed faraasat closed 2 weeks ago
same problem here
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
I encountered a similar issue while testing the rc version of ▲Next.js with 🇨🇭r3f using the command npx create-next-app@rc && npm i three @types/three @react-three/fiber
. Here's the error message:
⨯ node_modules/@react-three/fiber/node_modules/react-reconciler/cjs/react-reconciler.development.js (498:1) @ $$$reconciler ⨯ TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner') at __webpack_require__ ($/.next/server/webpack-runtime.js:33:42) at __webpack_require__ ($/.next/server/webpack-runtime.js:33:42) at eval (./app/_three/Experience.tsx:7:76) at (ssr)/./app/_three/Experience.tsx ($/.next/server/app/page.js:118:1) at Object.__webpack_require__ [as require] ($/.next/server/webpack-runtime.js:33:42) digest: "2001453440" 496 | var StaticMask = LayoutStatic | PassiveStatic | RefStatic; 497 | > 498 | var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ^ 499 | function getNearestMountedFiber(fiber) { 500 | var node = fiber; 501 | var nearestMounted = fiber;
Using pnpm i @react-three/fiber@alpha
fixed my issue
https://github.com/pmndrs/react-three-fiber/issues/3274#issuecomment-2135293586
Closing since the latest version of @react-three/fiber
has no support for React 19. You need to use @react-three/fiber@alpha
when you're using Next.js 15 Canaries or Release Candidates.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/faraasat/next-issue-cannot-read-reactcurrentowner
To Reproduce
three
,@react-three/fiber
,@react-three/drei
&@react-three/offscreen
.Current vs. Expected behavior
Model should be rendered correctly but got the following error:
TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner') at $$$reconciler (react-reconciler.development.js:80:96) at createRenderer (index-ba8afaa4.esm.js:221:31) at index-ba8afaa4.esm.js:1722:5 at [project]/node_modules/.pnpm/@react-three+fiber@8.16.6_react-dom@19.0.0-rc-f994737d14-20240522_react@19.0.0-rc-f994737d14-20240522_three@0.164.1/node_modules/@react-three/fiber/dist/index-ba8afaa4.esm.js [app-client] (:3001/ecmascript) (http://localhost:3001/_next/static/chunks/24fe2_%40react-three_fiber_dist_c7e87a._.js:2135:3) at runtime-base.ts:348:21 at runModuleExecutionHooks (runtime-base.ts:404:5) at instantiateModule (runtime-base.ts:346:5) at getOrInstantiateModuleFromParent (runtime-base.ts:444:10) at esmImport (runtime-utils.ts:228:18) at 24fe2_@react-three_fiber_distc7e87a..js:2142:393 at [project]/node_modules/.pnpm/@react-three+fiber@8.16.6_react-dom@19.0.0-rc-f994737d14-20240522_react@19.0.0-rc-f994737d14-20240522_three@0.164.1/node_modules/@react-three/fiber/dist/index-ba8afaa4.esm.js [app-client] (:3001/ecmascript) (http://localhost:3001/_next/static/chunks/24fe2_%40react-three_fiber_dist_c7e87a._.js:2145:3)
at runtime-base.ts:348:21
at runModuleExecutionHooks (runtime-base.ts:404:5)
at instantiateModule (runtime-base.ts:346:5)
at getOrInstantiateModuleFromParent (runtime-base.ts:444:10)
at esmImport (runtime-utils.ts:228:18)
at node_modules__pnpm425bbc..js:1169:430
at [project]/nodemodules/.pnpm/@react-three+offscreen@0.0.8@react-three+fiber@8.16.6_react-dom@19.0.0-rc-f994737d14-2024052_eqaez262h3qeb75o2rit6uq5sm/node_modules/@react-three/offscreen/dist/index.mjs [app-client] (:3001/ecmascript) (http://localhost:3001/_next/static/chunks/node_modules__pnpm_425bbc._.js:1560:3)
at runtime-base.ts:348:21
at runModuleExecutionHooks (runtime-base.ts:404:5)
at instantiateModule (runtime-base.ts:346:5)
at getOrInstantiateModuleFromParent (runtime-base.ts:444:10)
at esmImport (runtime-utils.ts:228:18)
at src8ea6ba..js:333:375
at [project]/src/components/modules/home/journey/model-render/journey.offscreen.tsx [app-client] (:3001/ecmascript) (http://localhost:3001/_next/static/chunks/src_8ea6ba._.js:415:3)
at runtime-base.ts:348:21
at runModuleExecutionHooks (runtime-base.ts:404:5)
at instantiateModule (runtime-base.ts:346:5)
at getOrInstantiateModuleFromParent (runtime-base.ts:444:10)
at esmImport (runtime-utils.ts:228:18)
at src_components9d9cfd..js:16:16
The above error occurred in the component:
React will try to recreate this component tree from scratch using the error boundary you provided, ReactDevOverlay.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
pakage.json
next.config.mjs