Skip to content

feat(expo): add support for Expo SDK 55 and 56#35904

Open
itsjithinv wants to merge 7 commits into
nrwl:masterfrom
itsjithinv:feat/expo-sdk-56-support
Open

feat(expo): add support for Expo SDK 55 and 56#35904
itsjithinv wants to merge 7 commits into
nrwl:masterfrom
itsjithinv:feat/expo-sdk-56-support

Conversation

@itsjithinv

@itsjithinv itsjithinv commented Jun 8, 2026

Copy link
Copy Markdown

Current Behavior

@nx/expo currently supports only Expo SDK 53 and 54, and new projects default to SDK 54.

There is no way to scaffold or migrate to SDK 55 or 56. Any newer SDK version falls back to the SDK 54 version set.

Separately, the plugin’s Metro integration assumes the standalone metro, metro-config, and metro-resolver packages. It also forces Metro’s projectRoot to the workspace root. Both behaviors are incompatible with the @expo/metro package family introduced in SDK 55.

As a result, generated SDK 55 and 56 apps crash during bundling with:

TypeError: Cannot read properties of undefined (reading 'transformFile')

Expected Behavior

@nx/expo supports Expo SDK 55 and 56, with SDK 56 used as the default for new apps.

This includes:

  • Full, npm-verified version matrices for:

    • SDK 55:

      • React Native 0.83.6
      • @expo/cli ~55.0.32
      • jest-expo ~55.0.18
    • SDK 56:

      • React Native 0.85.3
      • @expo/cli ~56.1.14
      • jest-expo ~56.0.4
      • React 19.2
  • SDK detection recognizes Expo majors 53 through 56.

  • Existing SDK 53 and 54 workspaces keep their exact version sets.

Metro integration is now SDK-aware:

  • withNxMetro and the Nx resolver use:

    • @expo/metro/metro-config
    • @expo/metro/metro-resolver
  • SDK 53 and 54 continue to fall back to the standalone Metro packages.

  • On SDK 55 and newer, withNxMetro no longer overrides Metro’s projectRoot to the workspace root.

  • Expo’s Babel transformer now resolves the app’s .babelrc.js correctly.

  • Workspace libraries remain resolvable through:

    • watchFolders
    • nodeModulesPaths
    • the custom resolveRequest
  • New SDK 55 and newer apps no longer install standalone metro-config, metro-resolver, or @expo/metro-config directly.

  • Generated metro.config.js files now extend expo/metro-config.

  • metro-config and metro-resolver are now optional peer dependencies.

A new migration, update-23-0-0-create-ai-instructions-for-expo-56, provides upgrade guidance for SDK 56.

Verification

Verified with:

  • version-utils unit tests, 30/30 passing, covering SDK 55 and 56 selection.
  • Full monorepo build passing.
  • A locally published --preset=expo workspace generating a real SDK 56 app.
  • The generated SDK 56 app bundling successfully with expo start --web and no manual configuration.

Related Issue(s)

Fixes #35714

Add full dependency version matrices for Expo SDK 55 and 56 and make
SDK 56 the default for newly generated Expo projects. Detection now
recognizes majors 53-56, and getExpoDependenciesVersionsToInstall picks
the matching version set for the installed SDK (falling back to 56).

The winter-runtime Jest configuration (introduced for SDK 54) now applies
to SDK 54+ instead of being v54-specific.
Add a migration that surfaces AI upgrade instructions for moving Nx
workspaces to Expo SDK 56 (covering React 19.2 / React Native 0.85, the
@expo/metro packaging change, Babel/Jest updates, and validation steps).
Expo SDK 55 moved Metro into the @expo/metro package family. @nx/expo was
installing the standalone metro-config/metro-resolver packages and merging /
resolving through them, which pulls in a second, incompatible Metro instance
and breaks bundling (TypeError: Cannot read properties of undefined reading
'transformFile').

- withNxMetro and the Nx resolver now prefer @expo/metro/metro-config and
  @expo/metro/metro-resolver, falling back to the standalone packages for
  SDK 53/54.
- withNxMetro no longer overrides Metro's projectRoot to the workspace root on
  SDK 55+. Expo's babel transformer resolves the project's .babelrc.js relative
  to projectRoot, so forcing the workspace root caused 'Cannot find module
  .babelrc.js'. Workspace libraries are still resolved via watchFolders,
  nodeModulesPaths and the custom resolveRequest.
- New SDK 55+ apps no longer install the standalone metro-config/metro-resolver
  packages nor @expo/metro-config directly (expo-doctor flags the latter); the
  generated metro.config.js extends expo/metro-config with mergeConfig from
  @expo/metro/metro-config.
- metro-config/metro-resolver are marked optional peer dependencies since they
  are only needed for SDK 53/54.
@itsjithinv itsjithinv requested a review from a team as a code owner June 8, 2026 14:39
@itsjithinv itsjithinv requested a review from leosvelperez June 8, 2026 14:39
@socket-security

socket-security Bot commented Jun 8, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 906986b

Expo SDK 55+ publishes @expo/cli with an exports map ("./*": "./*.js"), so
require.resolve('@expo/cli/build/bin/cli') now fails with MODULE_NOT_FOUND
because the bin file 'build/bin/cli' has no .js extension. This broke the
start, run, export, serve and prebuild executors (e.g. 'nx prebuild' →
Cannot find module '.../@expo/cli/build/bin/cli.js').

Resolve the CLI via the stable 'expo/bin/cli' entry point (the same one
'npx expo' uses), falling back to the legacy path for older SDKs.
@itsjithinv itsjithinv force-pushed the feat/expo-sdk-56-support branch from 490bfd6 to 56349b2 Compare June 8, 2026 14:56
@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 358f780

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 490bfd6

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 56349b2

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 906986b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(expo): support Expo SDK 56

2 participants