Cannot find entry file index.js with Expo XDE

Viewed 9357

When I load my react-native app in Expo I get the error: "Cannot find entry file index.js in any of the roots."

I am adding onto an existing React Web App, and have index.ios.js at the root level. Everything works fine locally, in simulator and through Xcode on my phone hardwired. I've converted my app with exp convert and integrated all info into exp.json.

All info for the ios app is contained in a folder called "ios".

Has anyone run into this or have any thoughts on how to get unstuck?

3 Answers

If you are using Expo, you need to go to your project folder and find the below file:

\node_modules\expo\AppEntry.js

import { KeepAwake, registerRootComponent } from 'expo';
import App from '../../App';

if (__DEV__) {
  KeepAwake.activate();
}

registerRootComponent(App);

and here just replace the App to Custom_Component_Name in the second line of import.

You can find the entry file by looking in the package.json file. In package.json you will find

{            
"main": "node_modules/expo/AppEntry.js"
}

AppEntry.json is the entry file by default in expo projects.

Related