Open durasj opened 1 year ago
After a ton of trial & error, I narrowed it down to these two lines from expo-router
:
https://github.com/expo/router/blob/expo-router%401.7.7/packages/expo-router/entry.js#L3,L7
import "@expo/metro-runtime";
// This file should only import and register the root. No components or exports
// should be added here.
import { renderRootComponent } from "expo-router/src/renderRootComponent";
If I make my own entry
file and drop those two, it works. Of course, I have to switch to import { registerRootComponent } from 'expo';
.
@durasj Can you explain the solution a bit further?
@zRelux In your index.js
, don't import expo-router/entry
. Instead, do:
const { App } = require('expo-router/_app');
registerRootComponent(App);
Ideally, only in production (!__DEV__
), though, as their entry file has some additional logic that is especially helpful during the development.
Which package manager are you using? (Yarn is recommended)
yarn
Summary
When we build a production IPA for iOS, the app crashes instantly with
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found.
:The same exact error occurs on a fresh
tabs@48
template with zero changes. We can reproduce this on two completely different Apple devices - one Mac mini and one MacBook Air.It works fine in dev client mode with Expo Go. It also works fine on Android, with an empty 48 expo template (so no router) and tabs@49. And no, unfortunately, we can't switch to v2 with SDK 49 yet.
Minimal reproducible example
https://github.com/durasj/expo-router-48-broken-reproduce
.yarn install
.eas build --platform ios --profile preview --local
to get an IPA to run on a device and try to open it.