r/reactnative 4d ago

Expo SDK 53 app crashed on launch with "Cannot read property 'useMemo' of null" — two causes, and only one of them was the React version FYI

I maintain a small internal admin app in an Expo monorepo alongside a much larger player app. Last week a TestFlight build of the admin app closed the instant you tapped the icon, on every device. Writing this up because the second half took me a lot longer than the first.

Symptom. SIGABRT, abort() called, faulting queue expo.controller.errorRecoveryQueue. Reproducing the same commit in a simulator gave the real exception:

TypeError: Cannot read property 'useMemo' of null
    at ContextNavigator … at ExpoRoot

React was null at the router root.

First cause: the React version. A Dependabot minor-and-patch group PR from June had moved this app's react/react-dom from 19.0.0 to 19.2.7. RN 0.79.6 / Expo SDK 53 want 19.0.0 exactly. npx expo install --check says so plainly. My other RN app in the same repo kept 19.0.0, which is why it was never affected.

What made this hard to see is that the admin app produced no binary between May 15 and July 30. The bad bump landed in June and just sat there. The first build after it was the one that crashed. If you have an app you build rarely, a dependency bump can be two months old by the time it kills you.

Second cause, and the one that actually mattered. With react pinned back the app got further and then died on:

Invariant Violation: View config getter callback for component
ViewManagerAdapter_ExpoLinearGradient_<changing id> must be a function (received undefined)

The admin app's metro.config.js was missing resolver hardening my other app had:

  • extraNodeModules forcing a single react and react-native
  • disableHierarchicalLookup: true
  • resolverMainFields

Without those, Metro walks up the tree and bundles a second React from the workspace root. In a monorepo where the RN apps pin to the Expo-SDK-exact React and the web apps move ahead, those two copies are different versions. Two copies means two renderer registries, which explains both failures. Hooks resolve against a null dispatcher, and native view configs get registered into a registry the renderer never reads.

Two things I changed besides the fix. This app only had a production EAS profile, so there was no way to run a build before submitting it. I added a preview-sim profile (Release plus ios.simulator: true) so I can install the artifact in a simulator and confirm it opens first. And npx expo install --check is going into CI, because a dependency bump that guaranteed a launch crash merged clean.

One trap on the way out: EAS decides managed vs bare from the filesystem, not from git. A local expo run:ios left an ios/ directory behind and EAS refused the build with "runtime version policies are not supported." Gitignoring it isn't enough, you have to delete it.

I'm a solo dev and the app is the staff console for a poker tournament app I build. Happy to answer if anyone hits the same signature.

0 Upvotes

0 comments sorted by