Issue when updating to Expo SDK 38 (iOS & Android)

Please provide the following:

  1. SDK Version: “~38.0.8”
  2. Platforms(Android/iOS/web/all): Android/iOS

I have upgraded from Expo SDK 35 to Expo SDK 38 and have been dealing with issues getting the app to start for about one week now.

I had just finished my entire app development with everything working perfectly on SDK 35 until it was time to upload it to the app store. Now I am forced to update the SDK for build purposes and now errors are delaying my entire release process.

I am getting hit with a multitude of issues with debugger / netinfo / etc. but I will start with the current issues below. Thanks for the help in advance.

For iOS the error shows as:
Invariant Violation: “main” has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and ‘AppRegistry.registerComponent’ wasn’t called.

For Android the error shows as:
TypeError: undefined in not an object (evaluating ‘firstFunction.apply’)

react-apollo.cjs.js:1073:58

My package.json below (I left out icon details etc.)
{
“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”
},
“dependencies”: {
@expo/react-apollo”: “^2.0.1-exp.0”,
@react-native-community/cli-debugger-ui”: “4.7.0”,
@react-native-community/netinfo”: “5.9.2”,
“aws-amplify”: “^3.0.19”,
“aws-amplify-react-native”: “^4.2.1”,
“aws-appsync”: “^3.0.4”,
“aws-appsync-react”: “^3.0.4”,
“aws-sdk”: “git://github.com/chrisradek/aws-sdk-js.git#fix-babel7”,
“babel-preset-expo”: “^8.2.3”,
“country-code-lookup”: “0.0.17”,
“country-list”: “^2.2.0”,
“countrycodes”: “0.0.5”,
“expo”: “~38.0.8”,
“expo-av”: “~8.2.1”,
“expo-cli”: “^3.21.13”,
“expo-contacts”: “~8.2.1”,
“expo-image-picker”: “~8.3.0”,
“expo-intent-launcher”: “~8.2.1”,
“expo-location”: “~8.2.1”,
“expo-permissions”: “~9.0.1”,
“expo-sms”: “~8.2.1”,
“expo-status-bar”: “^1.0.2”,
“expo-web-browser”: “~8.3.1”,
“graphql”: “^14.7.0”,
“graphql-tag”: “^2.9.2”,
“immutability-helper”: “^3.0.0”,
“lodash”: “^4.17.10”,
“react”: “~16.11.0”,
“react-apollo”: “^2.1.4”,
“react-dom”: “~16.11.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-38.0.1.tar.gz”,
“react-native-aws3”: “0.0.8”,
“react-native-date-picker”: “^2.7.0”,
“react-native-datepicker”: “^1.7.2”,
“react-native-fit-image”: “^1.5.5”,
“react-native-google-places-autocomplete”: “^1.3.9”,
“react-native-image-pan-zoom”: “^2.1.11”,
“react-native-input-scroll-view”: “^1.7.1”,
“react-native-inviewport”: “^1.1.0”,
“react-native-keyboard-aware-scroll-view”: “^0.5.0”,
“react-native-keyboard-spacer”: “^0.4.1”,
“react-native-material-dropdown”: “^0.11.1”,
“react-native-modal”: “^11.3.1”,
“react-native-modal-datetime-picker”: “^7.5.0”,
“react-native-modal-dropdown”: “^0.7.0”,
“react-native-phone-input”: “^0.2.4”,
“react-native-photo-view-ex”: “^1.0.4”,
“react-native-picker-select”: “^7.0.0”,
“react-native-search-box”: “0.0.19”,
“react-native-searchbar”: “^1.15.0”,
“react-native-timeago”: “^0.4.0”,
“react-native-view-more-text”: “^2.1.0”,
“react-native-web”: “~0.11.7”,
“react-navigation”: “1.5.11”,
“react-navigation-addons”: “0.0.0”,
“react-number-format”: “^4.0.8”,
“react-phone-number-input”: “^3.0.17”,
“react-redux”: “^5.0.6”,
“react-router-dom”: “^4.2.2”,
“recompose”: “^0.30.0”,
“redux”: “^3.7.2”,
“redux-thunk”: “^2.2.0”,
“shuffle-array”: “^1.0.1”,
“stripe-client”: “^1.1.5”,
“uuid”: “^3.2.1”
},
“devDependencies”: {
@babel/core”: “^7.8.6”,
“babel-preset-expo”: “~8.1.0”
},
“private”: true
}

@notbrent

Hi Brent - would you kindly take a look into this issue? Everything was working fine on SDK 35 and now when I need to build the project I need to upgrade to SDK 38. I have read through every blog on the issues with no avail.

I appreciate your help!!

I would do the upgrades step by step.

i.e. revert to where you started.
Find the blog post announcing SDK 36. Go through it and read all the info about what’s changed and breaking changes. I can’t remember when they started pointing to the changelog for the breaking changes, so check there too just in case. (Might have been SDK 36 or SDK 37.)
Run expo upgrade 36 and make sure you deal with any of the mentioned breaking changes. Upgrade dependencies that are not handled by expo upgrade if necessary but be careful not to upgrade to something that’s incompatible. So you might want to try it without upgrading and then upgrade one dependency at a time to see if anything breaks.

Then when you’re happy that your app is working with SDK 36 you can upgrade to SDK 37. Then to SDK 38.

That way you have a smaller set of potential problems with each change instead of having everything break at once.

2 Likes

In addition to Michael’s wonderful advice, I would also take a look if any of your dependencies are not compatible with React Native version 0.62. Some other Expo users noticed that this was causing their app to throw this error.

Cheers,
Adam

2 Likes

Thank you both for the valuable feedback. I will try from SDK 35 and see how it goes. Will get back soon with details if I was able to work through it from the beginning or not.

My error was solved by removing empty compose segments as shown below. I have this in 2 files. Once removed it started working. :slight_smile:

Before:

export default compose(

)(ComponentName)

Changed to:

export default ComponentName;

I’m afraid I have no idea what compose is :slight_smile: but I’m glad you’ve got it working :slight_smile:

1 Like

After handling all errors: try expo start -c

This us clearing your cache

1 Like

Thanks for sharing what the issue ended up being. You never know when someone else in the community will run into the same problem. For clarity’s sake, what package was compose from? Lodash?

The compose is used from the react-apollo package. I use it to wrap the graphql queries and mutations to the server.

import {compose, graphql } from ‘react-apollo’;

I kept seeing react-apollo in the error messages but could not wrap my head around the actual issue.

I went back to SDK 35 as suggested in the responses from the team, and then upgraded to SDK 36 where the error message became more specific to the actual file and line number where I found the empty compose segment. (No graphql queries or mutations inside the compose)

Once I removed that empty compose I started getting new errors on different files where I also had empty compose segments. After removing from all files needed my app started working again!

Now I will move on to SDK 37 and then 38. Thanks and hope it helps!

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