Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Peer dependency issue for mobx-react@6.3.1 #3828

Open
micnem opened this issue Feb 13, 2024 · 4 comments
Open

Peer dependency issue for mobx-react@6.3.1 #3828

micnem opened this issue Feb 13, 2024 · 4 comments
Labels

Comments

@micnem
Copy link

micnem commented Feb 13, 2024

Intended outcome:
npm install successfully with no peer dependency issues when on React 16.8.0 or higher, as stated in docs:

CleanShot 2024-02-13 at 10 52 37@2x

Actual outcome:
Getting error message:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: rumble_mobile@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || 16.9.0-alpha.0" from mobx-react@6.3.1
npm ERR! node_modules/mobx-react
npm ERR!   mobx-react@"6.3.1" 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 /Users/michaeln/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaeln/.npm/_logs/2024-02-13T08_50_41_925Z-debug.log

How to reproduce the issue:

Try installing mobx-react with React version 17.0.1.

For some reason I am unable to reproduce this issue in Sandbox / Expo but I am able to on this repo which was created with npx react-native@0.64.4 init and adding mobx@5.15.4 and mobx-react@6.3.1.

Versions

Listed in package.json of test repo.

@yaronlevi
Copy link

Same here, would love to get a solution to this...

robhybrid added a commit to robhybrid/mobx that referenced this issue Feb 15, 2024
@robhybrid
Copy link
Contributor

I think this was a documentation error. Mobx-react v6 won't support React v17. You should use mobx-react v7, or React v16. I opened a PR to fix the doc.

@mweststrate
Copy link
Member

From #3832 it superficially seems mobx-react 6 does work correctly with React 17, just the peerDependencies is outdated (e.g. that version is older than React 17 itself). That could be changed by updating the package.json, but since we in principle don't release patches on 3 major version behind packages, I recommend to instead upgrade mobx-react to a newer version.

@mweststrate
Copy link
Member

Closing as documentation has been updated per #3832. Thanks for the investigation @robhybrid!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants