tiagob / create-full-stack

Set up a TypeScript full stack with one command.
https://create-full-stack.com
MIT License
97 stars 9 forks source link

Incorrect peer dependencies #161

Closed gjolund closed 3 years ago

gjolund commented 3 years ago

Not really a bug, but I have seen this cause a lot of problems with react hooks in the past, especially in workspaces / lerna projects.

[4/5] Linking dependencies...
warning "workspace-aggregator-e9945fa9-3712-4d6b-bb41-185a3eab78dc > mobile > expo-auth-session@2.0.0" has incorrect peer dependency "@unimodules/core@~5.1.2".
warning "workspace-aggregator-e9945fa9-3712-4d6b-bb41-185a3eab78dc > mobile > expo-auth-session@2.0.0" has incorrect peer dependency "expo-application@~2.2.1".
warning "workspace-aggregator-e9945fa9-3712-4d6b-bb41-185a3eab78dc > mobile > react-test-renderer@16.14.0" has incorrect peer dependency "react@^16.14.0".
warning "workspace-aggregator-e9945fa9-3712-4d6b-bb41-185a3eab78dc > mobile > react-native > use-subscription@1.5.0" has incorrect peer dependency "react@^17.0.0".
tiagob commented 3 years ago

The expo versions are weird. It's worth filing an issue with Expo to learn more.

expo-auth-session@2.0.0

I'm using the versions from expo install which installs the correct npm packages that work with the specific expo SDK (in this case v39). The native code for these packages is bundled with Expo. Bundling the native code for specific packages with an Expo SDK version is how they avoid XCode and Android Studio dependencies and how Expo does Code Push. Unfortunately, some peer dependencies of the modules don't match (like what you posted) but changing to these modules instead causes the app to break and a different error to appear. In the case of "@unimodules/core@~5.1.2":

Some of your project's dependencies are not compatible with currently installed expo package version:
 - @unimodules/core - expected version range: ~5.5.0 - actual version installed: ~5.1.2
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]

Yet expo-auth-session@2.0.0 is the latest and asks for @unimodules/core@~5.1.2 which isn't used in Expo v39.

react-test-renderer@16.14.0

I can fix this. It should be

"react-test-renderer": "~16.13.1",

To match the react version.

use-subscription@1.5.0

This is interesting. We're using Expo's version of react-native which in turn uses use-subscription@1.5.0 which wants react@^17.0.0. However, Expo v39 depends on react ~16.13.1 so like expo-auth-session@2.0.0 I believe we're out of luck.

gjolund commented 3 years ago

yeah i have been seeing issues in all of my projects like this since react 17 came out

tiagob commented 3 years ago

https://github.com/expo/expo/issues/10869