Unable to resolve module @unimodules/core from node_modules/expo-screen-orientation/build/ScreenOrientation.js

Please provide the following:

  1. SDK Version: 43
  2. Platforms(Android/iOS/web/all): android and ios

upgraded project to 43 and got following error. Document says unimodules is depreciated, but i wonder why i am getting this error. looks like some how ScreenOrientation is trying to use it.

Error:
Unable to resolve module @unimodules/core from node_modules/expo-screen-orientation/build/ScreenOrientation.js: @unimodules/core could not be found within the project or in these directories:

Hi @rosnk

What does the dependencies section of your package.json look like?

Also, you might try removing node_modules and install your dependencies again.

no luck removing and installing node_modules folder.

my package.json file loos like this:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "lint": "eslint ./",
    "devtools": "react-devtools"
  },
  "dependencies": {
    "@apollo/client": "^3.5.7",
    "@expo-google-fonts/montserrat": "^0.2.0",
    "@expo-google-fonts/source-sans-pro": "^0.2.0",
    "@expo/ngrok": "^4.1.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-masked-view/masked-view": "0.2.5",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/material-top-tabs": "^6.0.2",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/stack": "^6.0.7",
    "@stripe/stripe-react-native": "0.2.2",
    "apollo-link-token-refresh": "^0.3.2",
    "apollo-upload-client": "^16.0.0",
    "axios": "^0.21.1",
    "expo": "^43.0.0",
    "expo-app-loading": "~1.2.1",
    "expo-application": "~4.0.0",
    "expo-auth-session": "~3.4.2",
    "expo-cellular": "~4.0.0",
    "expo-constants": "~12.1.3",
    "expo-facebook": "~12.0.3",
    "expo-firebase-recaptcha": "~2.0.2",
    "expo-font": "~10.0.3",
    "expo-google-app-auth": "~9.0.0",
    "expo-image-manipulator": "~10.1.2",
    "expo-image-picker": "~11.0.3",
    "expo-image-picker-multiple": "^1.4.1",
    "expo-random": "~12.0.1",
    "expo-status-bar": "~1.1.0",
    "expo-updates": "~0.10.15",
    "firebase": "8.2.3",
    "formik": "^2.2.6",
    "graphql": "^15.4.0",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "radio-buttons-react-native": "^1.0.4",
    "react": "17.0.1",
    "react-country-region-selector": "^3.0.2",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-calendars": "^1.1254.0",
    "react-native-elements": "^3.4.2",
    "react-native-elements-universe": "^0.0.0",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-maps": "0.28.1",
    "react-native-mime-types": "^2.3.0",
    "react-native-pager-view": "5.4.6",
    "react-native-paper": "^4.7.2",
    "react-native-read-more-text": "^1.1.2",
    "react-native-reanimated": "~2.2.0",
    "react-native-root-toast": "^3.2.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.8.0",
    "react-native-swiper-flatlist": "^2.0.6",
    "react-native-tab-view": "^3.1.1",
    "react-native-web": "0.17.1",
    "react-native-webview": "11.13.0",
    "react-redux": "^7.2.1",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "sharingan-rn-modal-dropdown": "^1.3.0",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "babel-plugin-module-resolver": "^4.1.0",
    "eslint": "^7.11.0",
    "eslint-plugin-react": "^7.21.5",
    "reactotron-react-native": "^5.0.0"
  },
  "resolutions": {
    "react-devtools-core": "^4.11.0"
  },
  "private": true
}

Error output in terminal on: npm run start

iOS Bundling failed 3432ms
Unable to resolve module @unimodules/core from /Volumes/roshan_1T/MAC/Documents/del_test/bump_version/42_with_navigation6/eKaa_app/node_modules/expo-screen-orientation/build/ScreenOrientation.js: @unimodules/core could not be found within the project or in these directories:
  node_modules
  ../../../node_modules

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
> 1 | import { EventEmitter, Platform, UnavailabilityError } from '@unimodules/core';
    |                                                              ^
  2 | import ExpoScreenOrientation from './ExpoScreenOrientation';
  3 | import { Orientation, OrientationLock, WebOrientationLock, WebOrientation, SizeClassIOS, } from './ScreenOrientation.types';
  4 | export { Orientation, OrientationLock, WebOrientationLock, WebOrientation, SizeClassIOS, };

looks like one of the package i am using " expo-image-picker-multiple" has a depedency called “expo-screen-orientation version 3.3.0” which is still using @unimodules/core instead of “expo-modules-core”.

i guess this package is the issue, has requested the owner of package for the upgrade of the package.

2 Likes

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