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

Could not resolve dependency: peer react@"^17.0.2" from react-reconciler@0.26.2 #280

Closed
foundrium opened this issue Aug 19, 2022 · 4 comments
Labels
compatibility Issue related to compatibility with different React and PixiJS versions.

Comments

@foundrium
Copy link

Description

When I install the latest version 1.0.1 alongside React 18, there are downstream dependency errors. I believe this is due to react-reconciler being at version 0.26.2 in react-pixi-fiber which has a peer dependency on React of version 17 instead of 18. See here

I did try cloning react-pixi-fiber locally and attempted to upgrade the version of react-reconciler. When I run npm run build && npm test though it fails tests inhooks.test.js. The errors do look specific to react-reconciler. I did a little more digging, but I am not familiar enough with the reconciler to see what the real issue might be. The tests failed with errors like TypeError: Cannot read property 'current' of undefined while running line ReactPixiFiber.updateContainer(element, root, parentComponent, callback);

Steps to reproduce

  1. npm create vite@latest
  2. fill out CLI form with a test app name (say rpf-test)
  3. cd rpf-test
  4. npm i
  5. npm i react-pixi-fiber pixi.js

Will fail with the following error

➜  rpf-test  npm i react-pixi-fiber pixi.js
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   peer react@"^18.2.0" from react-dom@18.2.0
npm ERR!   node_modules/react-dom
npm ERR!     react-dom@"^18.2.0" from the root project
npm ERR!     peer react-dom@">=16.0.0" from react-pixi-fiber@1.0.1
npm ERR!     node_modules/react-pixi-fiber
npm ERR!       react-pixi-fiber@"*" from the root project
npm ERR!   react@"^18.2.0" from the root project
npm ERR!   1 more (react-pixi-fiber)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2" from react-reconciler@0.26.2
npm ERR! node_modules/react-pixi-fiber/node_modules/react-reconciler
npm ERR!   react-reconciler@"^0.26.2" from react-pixi-fiber@1.0.1
npm ERR!   node_modules/react-pixi-fiber
npm ERR!     react-pixi-fiber@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/elaforc/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/elaforc/.npm/_logs/2022-08-19T12_31_22_964Z-debug.log

Additional info

  • react-pixi-fiber version: 1.0.1
  • React version: 18.2
  • ReactDOM version: 18.2
  • PixiJS version: 6.5.1
@michalochman
Copy link
Owner

Hi @foundrium, the version of react-reconciler currently used should work with React 18. All examples in this repo and sandboxes shared in README are using React 18.

Managing versions of dependencies is hard as you can see. The dependency we use says it's incompatibe, while it is ;)

We want to change the structure of this repository and exported code to mitigate compatibility issues with different versions of React (and it's dependencies) and PixiJS, but it will take some time.

You can try adding --legacy-peer-deps to your npm install to ignore the error if you want to start coding right away.

@michalochman michalochman added the compatibility Issue related to compatibility with different React and PixiJS versions. label Sep 20, 2022
@kresli
Copy link

kresli commented Dec 9, 2022

There are some breaking changes with react 18 (and new reconciler). I've got an error if I try using zustand

react.development.js:1676 Uncaught TypeError: dispatcher.useSyncExternalStore is not a function

The problem is the old reconciler (used by react-pixi-fiber) missing useSyncExternalStore
Is there a plan to upgrade to latest react?

@michalochman
Copy link
Owner

Hi @kresli, we definitely are looking forward to do it, however due to time constraints we have no concrete plan yet.

@michalochman
Copy link
Owner

Fixed in 2.0.0-alpha.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issue related to compatibility with different React and PixiJS versions.
Projects
None yet
Development

No branches or pull requests

3 participants