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

Cannot install for react 18 #2426

Closed
Olivernha opened this issue Jul 7, 2022 · 17 comments
Closed

Cannot install for react 18 #2426

Olivernha opened this issue Jul 7, 2022 · 17 comments

Comments

@Olivernha
Copy link

Olivernha commented Jul 7, 2022

In react 18 installed with vite , when installing react-beautiful-dnd, npm err happens.Anyone fix about it?

@hexwit
Copy link

hexwit commented Jul 8, 2022

@types/react-beautiful-dnd cannot be installed for react 18.

webapp$ npm i --save-dev @types/react-beautiful-dnd
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.5 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-beautiful-dnd
npm ERR!   react-beautiful-dnd@"^13.1.0" from the root project
npm ERR! 

@hexwit
Copy link

hexwit commented Jul 8, 2022

Update: deleting node_modules and installing deps again solved the problem.

@AmineDeflaoui
Copy link

Update: deleting node_modules and installing deps again solved the problem.

I tried delete node_modules and reinstall deps again, it does not solve the problem for me, until I downgrade React version to 17 again

Update : moving the content of the peer-dependency of [email protected] in package-lock.json solved the problem.
moving react From "peerDependencies":{
"react":"^16.8.5 || ^17.0.0"
}
to ->
"Dependencies":{
"react":"18.0.2"
}

@Jova266
Copy link

Jova266 commented Jul 12, 2022

is there another way to use this in react 18?

@Code-Divine
Copy link

Fix this for gods sake. There are no breaking changes just update react in your project.

@anti-duhring
Copy link

rade React version to 17 again

Try install with --force command

npm install react-beautiful-dnd --save --force

@kamami
Copy link

kamami commented Jul 13, 2022

Same problem

@AmineDeflaoui
Copy link

Same problem

Just update your react-beautiful-dnd dependencies it will solve the problem

@Jova266
Copy link

Jova266 commented Jul 13, 2022

rade React version to 17 again

Try install with --force command

npm install react-beautiful-dnd --save --force

Will --force cause some other problems?

@Jova266
Copy link

Jova266 commented Jul 13, 2022

Same problem

Just update your react-beautiful-dnd dependencies it will solve the problem

In order to have dependencies I need to install it first on react 17, then move to react 18? and after that change the dnd dependencies?

@AmineDeflaoui
Copy link

Yes that's what I did, I re-installed react 17.0.2 again , npm install => no problems , then I updated React to 18 npm install = > show the error , then I change the dependencies of react-beautiful-dnd to correspond to React 18 , npm install => no errors .
And For your first question :
if you do "npm install react-beautiful-dnd --save --force" or "--legacy-peer-deps" it will move react to peerDependencies and ignore all peerDependencies when installing, and each time yo udo npm install you always need to add --force or --legacy-peer-deps

@JClackett
Copy link

Pleaseee can this be updated

@Xhale1
Copy link

Xhale1 commented Aug 12, 2022

🎉 @hello-pangea/dnd now supports React 18 and react strict mode!

  1. npm install @hello-pangea/dnd
  2. Replace all imports of react-beautiful-dnd with @hello-pangea/dnd
  3. Enjoy :)

@anti-duhring
Copy link

Hello! I released a fork of this project which supports React 18.

Run npm install @hello-pangea/dnd and replace all imports of react-beautiful-dnd with @hello-pangea/dnd (I just did a find all and replace)

A few changes had to be made to the library to get it to work with React 18's development mode changes. Hoping to continue development there :)

https://github.com/hello-pangea/dnd

Nice! There's any discord/forum to support this lib? I would love to help

@Xhale1
Copy link

Xhale1 commented Aug 13, 2022

Nice! There's any discord/forum to support this lib? I would love to help

Sure sure! Glad you're interested in helping out!

https://discord.gg/3JqZpTFD (note: I just made this so it's pretty empty)

We should probably move things over to the hello-pangea/dnd repo so we don't spam notify people here / get too off topic.

@danieldelcore
Copy link
Collaborator

Accepted react versions have been updated. Thanks for the patience on this folks

vidbina pushed a commit to fortoolabs/prototype-01 that referenced this issue Sep 28, 2022
@bassamIHabash
Copy link

is there any update?

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

No branches or pull requests