Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with React 19 #8

Open
organdonor47 opened this issue Dec 10, 2024 · 1 comment
Open

Not working with React 19 #8

organdonor47 opened this issue Dec 10, 2024 · 1 comment

Comments

@organdonor47
Copy link

I am trying to get this package working in React 19 + nextjs v15 but get the folllowing error.

Cannot read properties of undefined (reading 'ReactCurrentDispatcher')
@whatisjery/react-fluid-distortion/dist/index.es.js (199:1)

component:

  <Canvas
    style={{
      position: 'fixed',
      top: 0,
      left: 0,
      height: '100vh',
      width: '100vw',
      background: '#efa29a',
    }}
  >
    <EffectComposer>
      <Fluid />
    </EffectComposer>
  </Canvas>

(simplified) package.json is:

 "@react-three/drei": "^9.120.4",
 "@react-three/fiber": "9.0.0-rc.1",
 "@react-three/postprocessing": "^2.16.3",
 "@whatisjery/react-fluid-distortion": "^1.3.6",
 "leva": "^0.9.35",
 "react": "19.0.0-rc.1",
 "react-dom": "19.0.0-rc.1",

any suggestions at all? found this issue related to the pmndrs/react-postprocessing#301, so maybe there is something related there?

@abdallahabusidu
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants