Open kjwrld opened 3 days ago
Next.js 15 is using React 19. React 19 changes its secret internal API from SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
to __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
.
React Three Fiber uses those React secret internals to access ReactCurrentOwner
and thus is no longer compatible with React 19 (this should be expected since you are already using something that would result in YOU_WILL_BE_FIRED
).
This is not the issue of React or Next.js, it is a bug of React Three Fiber. Please submit an issue there instead.
@kjwrld better downgrade to Next@14.2.16
Link to the code that reproduces this issue
https://github.com/frommybrain/r3f-starter
To Reproduce
To Reproduce:
create-next-app
next dev
)Current vs. Expected behavior
Current behavior: When trying to render a React Three Fiber component in a Next.js 15 application, the following error occurs:
Expected behavior: The React Three Fiber component should render without errors, as it does in previous versions of Next.js.
Provide environment information
Which area(s) are affected? (Select all that apply)
create-next-app, Developer Experience, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
This issue appears to be specific to Next.js 15 and its interaction with React Three Fiber. The error suggests a problem with React's internal workings, possibly due to changes in Next.js 15's handling of React or its bundling process. The issue occurs in the development environment and prevents the application from rendering properly.
It would be helpful to investigate any changes in Next.js 15 that might affect how it interacts with React's internals or how it bundles React-based libraries like React Three Fiber.
TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')