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

react 18 with react-composer@5.0.2 #870

Closed
hatimkhan opened this issue Apr 23, 2022 · 9 comments
Closed

react 18 with react-composer@5.0.2 #870

hatimkhan opened this issue Apr 23, 2022 · 9 comments
Labels
question Further information is requested

Comments

@hatimkhan
Copy link

What is your question:

I am getting an error when installing react-three/drei

npm i @react-three/drei
...
npm WARN Could not resolve dependency:
npm WARN peer react@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-composer@5.0.2
npm WARN node_modules/react-composer
npm WARN   react-composer@"^5.0.2" from @react-three/drei@9.5.3
npm WARN   node_modules/@react-three/drei
....
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0  || ^17.0.0" from @react-spring/animated@9.4.4
npm ERR! node_modules/@react-spring/three/node_modules/@react-spring/animated
npm ERR!   @react-spring/animated@"~9.4.4" from @react-spring/three@9.4.4
npm ERR!   node_modules/@react-spring/three
npm ERR!     @react-spring/three@"^9.3.1" from @react-three/drei@9.5.3
npm ERR!     node_modules/@react-three/drei
npm ERR!       @react-three/drei@"*" from the root project

I can't tell if this is because of react-composer, or react-three/xr ( I have installed react-three/xr )

@hatimkhan hatimkhan added the question Further information is requested label Apr 23, 2022
@baufometic
Copy link

baufometic commented Apr 25, 2022

Same warnings here. Narrowed it down to react-composer when installing drei.
Just created a new project with:
next ^12.1.5
react & react-dom ^18.0.0
@react-three/fiber ^8.0.12

All fine until @react-three/drei at which point a warning is thrown about React 18

@claritise
Copy link

Getting the same issue, seems to be broken with React 18 :(

@nemutas
Copy link

nemutas commented Apr 27, 2022

Getting the same issue with React 18.

@drcmda
Copy link
Member

drcmda commented Apr 28, 2022

looks like react-composer hasn't been touched in over 4 years, i'll start by making an issue. if it's not maintained any longer i have to fork it or add it to /helpers

@jamesplease
Copy link

React Composer was just updated. Please let me know if there are still issues that can be resolved through updates to that library.

drcmda added a commit that referenced this issue Apr 28, 2022
@nemutas
Copy link

nemutas commented Apr 30, 2022

Thank you for the fix.
But, I still get the following error in my environment.

npm i @react-three/drei
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN deprecated @types/nanoid@3.0.0: This is a stub types definition. nanoid provides its own type definitions, so you do not need this installed.

package.json

{
  "name": "drei-test",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@react-three/drei": "^9.6.0",
    "@react-three/fiber": "^8.0.12",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "three": "^0.140.0"
  },
  "devDependencies": {
    "@types/react": "^18.0.0",
    "@types/react-dom": "^18.0.0",
    "@types/three": "^0.139.0",
    "@vitejs/plugin-react": "^1.3.0",
    "typescript": "^4.6.3",
    "vite": "^2.9.5"
  }
}

@drcmda
Copy link
Member

drcmda commented Apr 30, 2022

seems unrelated though, i think we can close this issue then. just needs an update for nanoid. could someone do the pr?

@nemutas
Copy link

nemutas commented May 1, 2022

As stated in the error message, there seems to be no need to install @types/nanoid in the first place.
I am not familiar with the package, but if you are referencing @types/nanoid in drei, then you probably don't need to do that.

@CodyJasonBennett
Copy link
Member

I dropped nanoid in #901 for other reasons, peer deps should be fine now.

@CodyJasonBennett CodyJasonBennett closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants