EAS build does not install dependencies defined in other node modules

Hi!

We are splitting our app into several apps. We have create a common project, that contains components, that we intent to share between our apps.

Common project that we currently build locally

  "dependencies": {
    "@react-native-community/netinfo": "6.0.2",
    "expo": "43.0.0",
    "expo-updates": "0.10.15",
    "expo-web-browser": "10.0.3",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-gesture-handler": "1.10.2",
    "react-native-global-props": "1.1.5",
    "react-native-reanimated": "2.2.0",
    "react-native-safe-area-context": "3.3.2",
    "sentry-expo": "4.0.0"
  },

One of our apps that uses our common project

  "dependencies": {
    "expo": "43.0.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "our-common-project":"./file/path/to/common-v0.2.1.tgz"
    "react-native-gesture-handler": "1.10.2",
    "react-native-global-props": "1.1.5",
    "react-native-reanimated": "2.2.0",
    "react-native-safe-area-context": "3.3.2",
    "sentry-expo": "4.0.0"
  },

Local development in my expo managed app works
Build android apk works, eas build --platform android --profile=preview (with new default no-git-commit), but the app crashes on startup, because of the netinfo module is missing:

From Logcat:

2021-11-19 12:41:46.259 28372-28411/? E/ReactNativeJS: Error: @react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:
    
    • Run `react-native link @react-native-community/netinfo` in the project root.
    • Rebuild and re-run the app.
    • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
    • Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.
    * If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.

Anyone knows why dependencies from "our-common-project":"./file/path/to/common-v0.2.1.tgz" doesn’t get installed?

react-native autolinking will only install direct dependencies to your project. you will need to install @react-native-community/info as a dependency of every project that uses it. cli/autolinking.md at main · react-native-community/cli · GitHub

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.