Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jegueer opened this issue Feb 28, 2025 · 5 comments
Open
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@jegueer
Copy link

jegueer commented Feb 28, 2025

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

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Feb 28, 2025
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@Squikle
Copy link

Squikle commented Mar 2, 2025

I have the same problem with 0.78

@cortinico
Copy link
Contributor

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

Does this happen also on a vanilla RN app created with npx @react-native-community/cli init?

@ansajid2002
Copy link

{
"name": "blanktypescript",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~52.0.37",
"expo-status-bar": "~2.0.1",
"react": "^19.0.0",
"react-native": "0.78.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~19.0.10",
"typescript": "^5.3.3"
},
"private": true
}

Getting the same error with this

Steps to reproduce

  1. Created an blank expo app : npx create-expo-app@latest --template blank-typescript
  2. Updated the react and react native versions
  3. npm start

@douglowder
Copy link
Contributor

@cortinico I am also seeing this issue -- it happens after upgrading from 0.76.7 to 0.77.1, and only in release builds, not in debug builds. I'll try to create a vanilla repro, or at least one that has as few dependencies as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

6 participants