react-pixi-fiber
react-pixi-fiber copied to clipboard
Could not resolve dependency: peer react@"^17.0.2" from [email protected]
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
-
npm create vite@latest
- fill out CLI form with a test app name (say
rpf-test
) -
cd rpf-test
-
npm i
-
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: [email protected]
npm ERR! node_modules/react
npm ERR! peer react@"^18.2.0" from [email protected]
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 [email protected]
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 [email protected]
npm ERR! node_modules/react-pixi-fiber/node_modules/react-reconciler
npm ERR! react-reconciler@"^0.26.2" from [email protected]
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
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.
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?
Hi @kresli, we definitely are looking forward to do it, however due to time constraints we have no concrete plan yet.