ARTICLE AD BOX
Problem
When I open my app, splash screen appears a few seconds and then app gives crash. It starts consuming more and more memory as the time pass. After reaching 3GB of ram it gives crash and closes. There is no log in expo console but I've found related log in native ios logs:
here is my package.json
{ "name": "my_app", "main": "expo-router/entry", "version": "1.0.0", "scripts": { "start": "expo start", "reset-project": "node ./scripts/reset-project.js", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", "lint": "expo lint" }, "dependencies": { "@expo/vector-icons": "^15.0.3", "@react-native-async-storage/async-storage": "2.2.0", "@react-navigation/bottom-tabs": "^7.4.0", "@react-navigation/elements": "^2.6.3", "@react-navigation/native": "^7.1.8", "expo": "~54.0.25", "expo-constants": "~18.0.10", "expo-font": "~14.0.9", "expo-haptics": "~15.0.7", "expo-image": "~3.0.10", "expo-linear-gradient": "~15.0.7", "expo-linking": "~8.0.9", "expo-router": "~6.0.15", "expo-splash-screen": "~31.0.11", "expo-status-bar": "~3.0.8", "expo-symbols": "~1.0.7", "expo-system-ui": "~6.0.8", "expo-web-browser": "~15.0.9", "react": "19.1.0", "react-dom": "19.1.0", "react-native": "0.81.5", "react-native-gesture-handler": "~2.28.0", "react-native-reanimated": "~4.1.1", "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-svg": "15.12.1", "react-native-svg-transformer": "^1.5.2", "react-native-web": "~0.21.0", "react-native-worklets": "0.5.1" }, "devDependencies": { "@types/react": "~19.1.0", "eslint": "^9.25.0", "eslint-config-expo": "~10.0.0", "typescript": "~5.9.2" }, "private": true }What I use
Hardware: Mac mini m4 OS: macOS Tahoe 26.1 Simulator: Xcode simulator iPhone 16e (iOS 26.1) & Android studio emulator Pixel 9a Xcode version: Version 26.1.1 (17B100)Both of the android and ios simulator causing same problem. Whats going on? My app is not that much big. None of my components are being rendered. I guess the crash happens before react mounts. The app is stuck entirely on the splash screen and then crash.
Things I tried:
Reset Metro (expo start --clear) expo prebuild + pod install (tried build instead of Expo go but same problem happened.) Removing all context providers Removing custom fonts Testing both iOS & Android simulatorsI've also tried on a new fresh Expo project and it didn't cause this problem. It is probably causing from my ThemeProvide.tsx. When I remove that the problem was gone.
ThemeProvider.tsx
import { ThemeContext } from "@/context/theme"; import { dark, light } from "@/design"; import { UserPref } from "@/design/colors"; import AsyncStorage from "@react-native-async-storage/async-storage"; import { useCallback, useEffect, useMemo, useState } from "react"; import { ColorSchemeName, useColorScheme } from "react-native"; import { ProviderProps } from "../provider.types"; const STORAGE_KEY = "app_theme_pref"; const resolveMode = (userPref: UserPref, sys: ColorSchemeName) => { const scheme = sys ?? "light"; return userPref === "system" ? scheme : userPref; }; const ThemeProvider = ({ children }: ProviderProps) => { const [userPref, setUserPref] = useState<UserPref>("system"); const sys = useColorScheme(); useEffect(() => { (async () => { const saved = await AsyncStorage.getItem(STORAGE_KEY); if (saved === "light" || saved === "dark" || saved === "system") { setUserPref(saved); } })(); }, []); const effectiveMode = useMemo( () => resolveMode(userPref, sys), [userPref, sys] ); const theme = effectiveMode === "dark" ? dark : light; const updateUserPref = useCallback(async (pref: UserPref) => { setUserPref(pref); await AsyncStorage.setItem(STORAGE_KEY, pref); }, []); const val = useMemo( () => ({ theme, userPref, effectiveMode, updateUserPref }), [theme, userPref, effectiveMode, updateUserPref] ); return <ThemeContext.Provider value={val}>{children}</ThemeContext.Provider>; }; export default ThemeProvider;Question
Why do both iOS and Android simulators trigger a Hermes OOM before React mounts?
Is this a known bug with Expo SDK 54 + RN 0.81 + Hermes on simulators?
What should I do or try to identify the root of the problem?
