-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
use-subscription could not resolve dependency for react 18 #33540
Comments
Any update @jenskuhrjorgensen? |
@hoIIer no updates |
Got the same issue, fixed with npm legacy peer depencies flag on install or update. That way react 17.0.2 doesnt get installed because of react native. I think a fix would be to bump the peer dependency on react to 18 or bigger then 17 |
@sergioUjo The dependency problem originates from use-subscription >=1.6.0 which should not be required by RN, you should keep React 17 as is. There is already a PR (#33541) on the way. You may try to mitigate the issue manually on your project by explicitly adding in your package.json the import of use-subscription <1.6.0 in the meantime. |
I have the same problem.
I created this project using 'npx create-react-native library xx'. yarn
react-native View, Text etc all component error:
react-native@17 vs react-native@18 17:
18
|
Solutions to the above problems: |
Summary: Starting with 1.6.0 this package relies on react 18 which is currently not supported by rn See https://github.com/facebook/react/blob/main/packages/use-subscription/package.json#L18 Fixes #33540 ## Changelog [General] [Fixed] - Pin use-subscription to < 1.6.0 Pull Request resolved: #33541 Test Plan: Run `yarn` in the following directories: `xplat/js/RKJSModules` `xplat/js/react-native-github` (Identified from jest test) `xplat/js/public` (Identified from yarn-validate) `js1 build buckfiles` (From diff signals) Reviewed By: yungsters Differential Revision: D35333789 Pulled By: ryancat fbshipit-source-id: bdb6232ccd2c5cece397f781609af2de7d36c5ff
I believe this issue is still ongoing for expo I fixed it by forcing the version in my package.json
|
Summary: Starting with 1.6.0 this package relies on react 18 which is currently not supported by rn See https://github.com/facebook/react/blob/main/packages/use-subscription/package.json#L18 Fixes facebook#33540 [General] [Fixed] - Pin use-subscription to < 1.6.0 Pull Request resolved: facebook#33541 Test Plan: Run `yarn` in the following directories: `xplat/js/RKJSModules` `xplat/js/react-native-github` (Identified from jest test) `xplat/js/public` (Identified from yarn-validate) `js1 build buckfiles` (From diff signals) Reviewed By: yungsters Differential Revision: D35333789 Pulled By: ryancat fbshipit-source-id: bdb6232ccd2c5cece397f781609af2de7d36c5ff
Description
The latest react-native (v0.68.0) depends on use-subscription: ^1.0.0, but v1.6.0 of use-subscription was just released two days ago and it peer depends on react: ^18.0.0 whereas react-native 0.68.0 peer depends on react v17.0.2 which is also what is installed in the vanilla React Native project (npx react-native init). This results in this warning when running
npm install
:(the warning is also present when using yarn)
Version
0.68.0
Output of
npx react-native info
System:
OS: macOS 12.2.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 2.97 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Watchman: 2022.01.31.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/be9276/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.3/13E113 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.0 => 0.68.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
npx react-native init VanillaRN
cd VanillaRN
rm -rf node_modules
npm i
The text was updated successfully, but these errors were encountered: