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

Add R3F v9 in peerDependencies #2253

Closed
verekia opened this issue Dec 6, 2024 · 13 comments · Fixed by #2259
Closed

Add R3F v9 in peerDependencies #2253

verekia opened this issue Dec 6, 2024 · 13 comments · Fixed by #2259
Labels
enhancement New feature or request released

Comments

@verekia
Copy link
Contributor

verekia commented Dec 6, 2024

Installing R3F v9 with Drei gives the following error due to the @react-three/fiber@">=8.0 peerDependency:

➜  next15-app-r3f9-react19 git:(main) ✗ npm i
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: @react-three/[email protected]
npm error node_modules/@react-three/fiber
npm error   @react-three/fiber@"9.0.0-rc.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @react-three/fiber@">=8.0" from @react-three/[email protected]
npm error node_modules/@react-three/drei
npm error   @react-three/drei@"9.120.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error

With the following dependencies:

  "dependencies": {
    "@react-three/drei": "9.120.0",
    "@react-three/fiber": "9.0.0-rc.1",
    "react": "19.0.0",
    "react-dom": "19.0.0",
    "next": "15.0.4",
    "three": "0.171.0"
  }
  • Node v22.10.0
  • NPM v10.9.0

In the meantime, npm i --legacy-peer-deps works.

@verekia verekia added the enhancement New feature or request label Dec 6, 2024
@abernier
Copy link
Member

abernier commented Dec 6, 2024

should we add || ^9 for drei's fiber peerDep?

@abernier
Copy link
Member

abernier commented Dec 7, 2024

i've checked and unintuitively:

semver.satisfies('9.0.0-rc.1', '>=8.0') // false

as well as

semver.satisfies('9.0.0-rc.1', '^8 || ^9') // false

we can either specifically add || 9.0.0-rc.1 in drei's peerDep or wait for 9.0.0?

@verekia what do you think?

@MuntasirSZN
Copy link

Any Update?

@MuntasirSZN
Copy link

MuntasirSZN commented Dec 7, 2024

i've checked and unintuitively:

semver.satisfies('9.0.0-rc.1', '>=8.0') // false

as well as

semver.satisfies('9.0.0-rc.1', '^8 || ^9') // false

we can either specifically add || 9.0.0-rc.1 in drei's peerDep or wait for 9.0.0?

@verekia what do you think?

Currently, i think || 9.0.0-0 will do.

@verekia
Copy link
Contributor Author

verekia commented Dec 8, 2024

We can use ^9.0.0-0 to allow pre-releases of 9.0.0 too.

semver.satisfies('9.0.0-rc.1', '^8 || ^9.0.0-0') // true
semver.satisfies('9.1.1', '^8 || ^9.0.0-0') // true

semver.satisfies('9.2.3-rc.4', '^9.0.0-0') // false

I'll make a PR :)

@abernier
Copy link
Member

abernier commented Dec 9, 2024

#2259 merged, release 9.120.4 in progress...

i didn't know that -0 semver trick, thank you

@verekia can you confirm drei 9.120.4 is now installable with r3v v9-rc ?

Copy link

github-actions bot commented Dec 9, 2024

🎉 This issue has been resolved in version 9.120.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@verekia
Copy link
Contributor Author

verekia commented Dec 9, 2024

Ah, we're going to need to update the react peerDep as well, since Drei requires 18 and R3F9 requires 19:

https://github.com/pmndrs/drei/blob/master/package.json#L135
https://github.com/pmndrs/react-three-fiber/blob/v9/packages/fiber/package.json#L63

@abernier
Copy link
Member

abernier commented Dec 9, 2024

but as of now, i don't think drei is yet compatible with React 19, is it?

@verekia
Copy link
Contributor Author

verekia commented Dec 9, 2024

But since R3F 9 is not compatible with React 18, we're a bit stuck here.

@abernier
Copy link
Member

abernier commented Dec 9, 2024

let's wait otherwise, i don't think there is a special rush on going react 19 until r3f v9 is here, don't you think?

@abernier
Copy link
Member

abernier commented Dec 9, 2024

but maybe drei is compatible with react 19, i haven't tested...

@verekia
Copy link
Contributor Author

verekia commented Dec 9, 2024

I am using Drei in my React 19, R3F9 game. So far the components I am using work, except MultiMaterial. I think we can expect issues with a lot of them, so maybe this deserves to be a major bump + alpha version. It would be clearer that this new version of Drei is supposed to go with React 19, R3F9, and that there will be issues during this transition phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants