Skip to content

"EarlyJsError: Property 'setImmediate' doesn't exist" after upgrading to v0.77 #49739

Description

@jegueer

Description

I have just upgraded to React Native 0.77.1 from version 0.76.6 using this guide to perform the upgrade: React Native 0.77 is now available with Expo SDK 52. I was running the latest version of Expo before upgrading React Native. Everything worked fine before the upgrade, but now I get the error: "EarlyJsError: Property 'setImmediate' doesn't exist." I manually installed the setimmediate package and imported it at the top of the index file, but that didn't fix the error. This is my package.json file:{ "name": "appname", "version": "1.0.0", "main": "expo-router/entry", "scripts": { "start": "expo start", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web" }, "dependencies": { "@babel/runtime": "^7.26.0", "@expo/vector-icons": "^14.0.4", "@fortawesome/fontawesome-svg-core": "^6.7.2", "@fortawesome/free-brands-svg-icons": "^6.7.2", "@fortawesome/free-regular-svg-icons": "^6.7.2", "@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/react-native-fontawesome": "^0.3.2", "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-vector-icons/common": "^11.0.0", "@react-native-vector-icons/fontawesome": "^4.7.0", "@react-native-vector-icons/fontawesome6": "^6.7.1", "@react-navigation/bottom-tabs": "^7.2.0", "@react-navigation/drawer": "^7.1.1", "@react-navigation/native": "^7.0.14", "@react-navigation/stack": "^7.1.1", "axios": "^1.7.9", "expo": "^52.0.35", "expo-blur": "~14.0.3", "expo-constants": "~17.0.3", "expo-font": "~13.0.3", "expo-linear-gradient": "~14.0.2", "expo-linking": "~7.0.5", "expo-router": "~4.0.15", "expo-secure-store": "^14.0.1", "expo-status-bar": "~2.0.1", "react": "18.3.1", "react-dom": "18.3.1", "react-native": "~0.77.1", "react-native-checkbox": "^2.0.0", "react-native-dev-menu": "^4.1.1", "react-native-gesture-handler": "~2.22.0", "react-native-linear-gradient": "^2.8.3", "react-native-reanimated": "~3.16.7", "react-native-safe-area-context": "~5.1.0", "react-native-screens": "~4.8.0", "react-native-svg": "15.8.0", "react-native-vector-icons": "^10.2.0", "react-native-web": "~0.19.13", "zustand": "^5.0.3", "setimmediate": "^1.0.5", "react-native-webview": "~13.13.1" }, "devDependencies": { "@babel/cli": "^7.26.4", "@babel/core": "^7.26.0", "@types/react": "~18.3.12", "metro-react-native-babel-preset": "^0.77.0", "typescript": "^5.3.3" }, "private": true, "expo": { "install": { "exclude": [ "react-native@~0.76.6", "react-native-reanimated@~3.16.1", "react-native-gesture-handler@~2.20.0", "react-native-screens@~4.4.0", "react-native-safe-area-context@~4.12.0", "react-native-webview@~13.12.5" ] } } }

I also tried polyfilling it manually but it didn't work either. This is the polyfill:

if (typeof global.setImmediate === 'undefined') { global.setImmediate = (callback, ...args) => setTimeout(callback, 0, ...args); }

Image

Steps to reproduce

  1. Exclude packages from version validations to avoid installing incompatible packages.
  2. Upgrade React Native using: npx expo install react-native@~0.77.1 react-native-reanimated@~3.16.7 react-native-gesture-handler@~2.22.0 react-native-screens@~4.8.0 react-native-safe-area-context@~5.1.0 react-native-webview@~13.13.1
  3. Restart Expo with a clean cache.
  4. Launch the app on iPhone/Android simulator or physical device.

React Native Version

0.77.1

Affected Platforms

Runtime - Android, Runtime - iOS, Build - MacOS, Build - Windows

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.3.1
  CPU: (8) arm64 Apple M1
  Memory: 196.00 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: ~/.nvm/versions/node/v22.14.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v22.14.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.1
    wanted: 0.77.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

No logs are provided because none are generated. The screenshot shows the stacktrace.

Reproducer

None. Don't know how to do it.

Screenshots and Videos

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions