packages/expo/src/migrations/update-23-1-0/ai-instructions-for-expo-56.md
These instructions guide you through migrating an Nx workspace containing Expo projects to Expo SDK 56. The most common starting points are Expo SDK 54 and SDK 55. Work systematically through each breaking change category and validate after every step.
Identify all Expo projects:
nx show projects --with-target start
Locate all Expo configuration files:
app.json or app.config.{js,ts}metro.config.{js,ts}babel.config.{js,ts}project.json files for Expo-related configurationRecord the current SDK for each project (read expo in each app's package.json).
Check for Detox E2E testing projects:
detox in package.json dependenciesdetox.config.js or .detoxrc.js filesWhen updating an app's package.json, align to these versions:
expo: ~56.0.0@expo/cli: ~56.1.14react: ^19.2.0react-dom: ^19.2.0@types/react: ^19.2.0react-native: 0.85.3react-native-web: ~0.21.0@expo/metro: ~56.0.0@expo/metro-runtime: ~56.0.14babel-preset-expo: ~56.0.14jest-expo: ~56.0.4expo-splash-screen: ~56.0.10expo-status-bar: ~56.0.4expo-system-ui: ~56.0.5Prefer
npx expo install --fixinside each project to let Expo resolve the exact compatible native module versions for SDK 56, then reconcile the workspace rootpackage.json.
Expo SDK 56 uses React 19.2 and React Native 0.85.
Action Items:
@types/react to ^19.2.0nx run-many -t typecheck@expo/metroStarting with SDK 55, Expo bundles Metro through the @expo/metro package family rather than depending on the standalone metro, metro-config, and metro-resolver packages directly.
Search Pattern: metro.config.{js,ts}, direct imports of metro-config / metro-resolver
Action Items:
@expo/metro (~56.0.0) as a direct dependency — the generated metro.config.js and withNxMetro require @expo/metro/metro-config, which package managers like pnpm won't resolve from a transitive dependencygetDefaultConfig from expo/metro-config and mergeConfig from @expo/metro/metro-configmetro / metro-config / metro-resolver, and do not install @expo/metro-config directly (expo-doctor flags it) — @expo/metro replaces themwithNxMetro from @nx/expo, leave it in place — it continues to merge Nx workspace resolutionnpx expo start --clearSDK 56 updates babel-preset-expo to ~56.0.14.
Action Items:
babel-preset-expo to ~56.0.14npx expo start --clearExpo v54+ (including SDK 56) relies on the winter runtime. New projects generated by @nx/expo no longer use the custom jest.resolver.js; instead src/test-setup.ts mocks expo/src/winter/ImportMetaRegistry and polyfills structuredClone.
Action Items:
jest.resolver.js and the resolver: line from jest.config.tssrc/test-setup.ts mocks ImportMetaRegistry and polyfills structuredClonejest-expo to ~56.0.4Verify Detox supports Expo SDK 56 before migrating. If your workspace includes Detox projects and Detox has not yet published SDK 56 support, ask the user:
"Your workspace contains Detox E2E tests. Confirm Detox supports Expo SDK 56 before proceeding, or these tests may not run after migrating."
Consider Maestro as an alternative if Detox support lags.
npx expo start --clear
rm -rf node_modules/.cache/metro-*
nx reset
nx run-many -t test -p PROJECT_NAME
nx affected -t test,lint,typecheck
nx run PROJECT_NAME:run-ios
nx run PROJECT_NAME:run-android
@expo/metro; caches clearednpx expo install --fix per project to resolve native module versions.