CRNA app entry file with new Expo CLI


#1

So I’ve just upgraded a CRNA project to the new Expo CLI, and followed instructions for changing ```

"scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest",
    "postinstall": "rndebugger-open"
  },

to

"scripts": {
    "start": "expo start",
    "eject": "expo eject",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "test": "jest",
    "postinstall": "rndebugger-open"
  },

and removing the react-native-scripts dependency. However, I also have a CRNA boilerplate line in package.json:

"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js"

and without that line I get Cannot find entry file index.js in any of the roots when I build.

What am I supposed to replace this with? I haven’t seen it addressed in any of the Expo docs. Thanks!


#2

I believe this answers your question.
https://docs.expo.io/versions/latest/sdk/register-root-component#i-created-my-project-before-sdk-18

A bit hidden. But replace the react-native-scripts entry with ’ node_modules/expo/AppEntry.js


#3

Almost there. I re-yarn installed, but now I get “The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo” red screen.

After googling, this seems to occur when sdk/expo versions in app.json and package.json are mismatched, but mine are all at v29.

EDIT: I tried upgrading to SDK v30 just to see, but this had no effect. expo doctor returns with no issues.

EDIT: Uninstall Expo app on simulator, quit and restart simulator, now it works!


closed #4

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