Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find entry file index.js with Expo XDE

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?

like image 296
Anthony Avatar asked Dec 24 '22 17:12

Anthony


2 Answers

check you package.json and rename index.js to your entry file.

//...
},
  "main": "index.js"
}
like image 133
KimHau Avatar answered Dec 28 '22 08:12

KimHau


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.

like image 30
Rohit Singh Avatar answered Dec 28 '22 07:12

Rohit Singh