The eject appears to have succeeded, but when I run yarn ios I get the following error:
Error: @build-script-error-begin
Error loading Metro config and Expo app config: Expected `fromDir` to be of type `string`, got `undefined`
If I attempt to build in XCode, I get the same error.
I Googled and the suggested solution on StackOverflow does not apply to my case, because “__dirname” is already being passed to “getDefaultConfig” in my “metro.config.js” file.
this is likely a red herring. share your full error message, not just that block. it’s possible that your metro.config.js isn’t even loading, for example
are you using a monorepo? do you have a custom "main" in package.json?
there’s an issue where react-native ignores any entry file that is not index.js or specified via ENTRY_FILE env var, we work around this by creating index.js and deleting main in package.json when running prebuild (aka eject)… but if you have an index.js or a main that is not the default, we skip this and show you information about that in your logs.
so, make sure you have an index.js that looks like this otherwise metro config will fail to load with a fairly unclear error msg like what you’re seeing above
Amazing! I switched from app.js → index.js and removed the main entry from package.json. Now, the ejected app is building and loading successfully.
IIRC I originally switched to app.js to fix an issue I had loading the app with Electron, but that was over 18 months ago, and it appears Expo now has first-class support for Electron.
Thanks so much, you potentially saved me hours of debugging =)