-
Notifications
You must be signed in to change notification settings - Fork 116
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
React 19 support #301
Comments
Same issue 👍 |
We might need to consider updating Effectcomposer to match react 19 as well 👍 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@CodyJasonBennett can you do an experimental release? It seems like the action didn't work |
I'm still seeing the same issue (
Code: <Selection>
<EffectComposer multisampling={8} autoClear={false}>
<Outline blur edgeStrength={100} width={1000} />
</EffectComposer>
<Select enabled>
<mesh position={[0, 0, 0]}>
<boxGeometry />
<meshStandardMaterial color="orange" />
</mesh>
</Select>
</Selection> |
This comment has been minimized.
This comment has been minimized.
Ah, ok, I worked out I need to build the latest rc -- but that's still not working for me: Install the rc branch instead of 2.19.0:
Then build the dist directory:
Copy the resulting dist directory into your Now I can import the latest and greatest, but I get a different error running the code in #301 (comment):
I've spent 1/2 day on trying to get this to work, but not looking good. I'll probably work out how to revert my project to React 18 in the meantime. If anyone could put together a guide on how to navigate, I would say there are lots of new users running into issues at the moment. 🙏 Thank you for a great package! |
You should stay on React 18 if this is a production project. NPM is correct in barring you from install here since this library is not forwards compatible. React 19 is not supported by much of NPM or our ecosystem yet, despite direct collaboration with Meta and Vercel. It will take some time before we can get release candidates up here due to a mishap on NPM's side and to test/iterate until release. |
Yep, fair enough. The issue perhaps lies with Next.js. My normal workflow for starting a new project is to go to the Next.js website and copy the install command, since I can never remember it. I did that a few days for this new project, and here we are. I've spent about 1.5 days trying to select a mesh in my scene, and tearing my hair out. I suspect there will be a lot of new users in the same boat. Will downgrade to React 18 now. |
Next 15 ships with an experimental build of React 19, before that was released by Meta on NPM or types to DefinitelyTyped. You would need to downgrade to Next 14 to use React 18 (also experimental). This is an unfortunate situation since it makes using ecosystem renderers with Next not entirely possible (e.g., using Next router hooks will crash in R3F). Fortunately, we're not far from release, as we're only waiting for things to clear up on NPM for Drei and many libraries to hit RC and then stable. |
For those adventurous, we're now putting out release candidates for react-postprocessing v3. See https://github.com/pmndrs/react-postprocessing/releases/tag/v3.0.0-rc.0 for a tentative list of changes, which includes React 19 support. |
Thanks @CodyJasonBennett that's awesome! |
@CodyJasonBennett should I open a seperate ticket? I'm getting a "Failed to compile." when building: ./node_modules/@react-three/postprocessing/src/effects/Autofocus.tsx:17:30
Type error: An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled.
15 | import { easing } from 'maath'
16 |
> 17 | import { DepthOfField } from './DepthOfField.tsx'
| ^
18 | import { EffectComposerContext } from '../EffectComposer.tsx'
19 |
20 | export type AutofocusProps = React.ComponentProps<typeof DepthOfField> & {
Static worker exited with code: 1 and signal: null
Error: Command "npm run build" exited with 1 stack used: Next.js 15 canary, React 19 canary, r3f 9.0.0-rc.5, @react-three/postprocessing 3.0.0-rc.1 EDIT: as a workaround I added allowImportingTsExtensions to my tsconfig, which fixed the build process for me tsconfig.json {
"compilerOptions": {
"allowImportingTsExtensions": true
}
} EDIT 2: thank you for the quick update @CodyJasonBennett , the 3.0.0-rc.2 fixes the above problem :) |
I put out a quick fix in v3.0.0-rc.2. |
Me, too, but because of my |
I created a reproduction repository for an error in the react postprocessing effectcomposer when using the latest r3f v9 beta 1 package (as well as next.js 15 / react 19)
The error message that gets catched by Next.js is the following:
which corresponds to line 139 https://github.com/pmndrs/react-postprocessing/blob/master/src/EffectComposer.tsx#L139 in the typescript source file
I wasn't sure if this repository is the right place to open an issue, as r3f v9 transitioned to a reconciler (previously core renderer) due to heavy changes in react 19, I assume the problem in the effectcomposer might be related to those changes
The text was updated successfully, but these errors were encountered: