Skip to content

[jest-expo] SDK 57: peer dependency @react-native/jest-preset@^0.85.0 conflicts with react-native 0.86.0 #47435

Description

@SebPez

Minimal reproducible example

Reproducible from the unmodified official SDK 57 blank template — https://github.com/expo/expo/tree/sdk-57/templates/expo-template-blank (the exact code create-expo-app generates): npx create-expo-app@latest repro --template blank --no-install cd repro npx expo install jest-expo jest # per https://docs.expo.dev/develop/unit-testing/ The install fails immediately (npm 10+/11, Node 22, no legacy-peer-deps): npm error code ERESOLVE npm error While resolving: react-native@0.86.0 npm error Found: @react-native/jest-preset@0.85.3 npm error peer @react-native/jest-preset@"^0.85.0" from jest-expo@57.0.0 npm error Could not resolve dependency: npm error peerOptional @react-native/jest-preset@"0.86.0" from react-native@0.86.0 No third-party libraries and no code changes — only jest-expo/jest added to the blank template exactly as the Expo unit-testing docs instruct. The failure occurs during dependency resolution, before any code runs, so these commands are the complete reproduction.

Steps to reproduce

Summary: jest-expo@57.0.0 declares a peer dependency on @react-native/jest-preset@^0.85.0, but SDK 57 uses react-native@0.86.0, which has a peerOptional on @react-native/jest-preset@0.86.0. npm cannot satisfy both, so npm install fails with ERESOLVE on any SDK 57 project that includes jest-expo.

Repro: create an SDK 57 project, add jest-expo@~57.0.0 to devDependencies, run npm install (npm 10+, no legacy-peer-deps).

Cause: #45699 introduced the peer as ^0.85.0; #46950 upgraded react-native to 0.86.0 without bumping it. Presumably it should be ^0.86.0 (or track the RN version per SDK).

Workaround: "overrides": { "@react-native/jest-preset": "0.86.0" } in package.json.

Environment

expo-env-info 2.1.0 environment info:
    System:
      OS: macOS 26.3.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.22.3 - /Users/sebastian/.nvm/versions/node/v22.22.3/bin/node
      npm: 10.9.8 - /Users/sebastian/.nvm/versions/node/v22.22.3/bin/npm
      Watchman: 2025.03.10.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 25.5, iOS 26.5, macOS 26.5, tvOS 26.5, visionOS 26.5, watchOS 26.5
    IDEs:
      Android Studio: 2024.2 AI-242.23726.103.2422.13016713
      Xcode: 26.5/17F42 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~57.0.1 => 57.0.1 
      expo-router: ~57.0.2 => 57.0.2 
      react: 19.2.3 => 19.2.3 
      react-dom: 19.2.3 => 19.2.3 
      react-native: 0.86.0 => 0.86.0 
      react-native-web: ~0.21.0 => 0.21.2 
    npmGlobalPackages:
      eas-cli: 19.1.0
    Expo Workflow: managed

Expo Doctor Diagnostics

20/20 checks passed. No issues detected!

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reviewIssue is ready to be reviewed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions