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

TypeError: undefined is not an object (evaluating 'ReactCurrentActQueue$1.isBatchingLegacy') #34079

Closed
dcr31000 opened this issue Jun 27, 2022 · 22 comments

Comments

@dcr31000
Copy link

dcr31000 commented Jun 27, 2022

Description

Since this morning, I cannot launch my app in debug mode on Android.

My app build successfully but, I got this in metro:
`
BUNDLE ./index.js

LOG Running "MyApp" with {"rootTag":1}
ERROR TypeError: undefined is not an object (evaluating 'ReactCurrentActQueue$1.isBatchingLegacy')
ERROR TypeError: undefined is not an object (evaluating 'ReactCurrentActQueue$1.isBatchingLegacy')
`

My app has a blank page.

This is my dependencies:
"dependencies": { "@react-native-masked-view/masked-view": "^0.2.6", "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "@react-navigation/stack": "^6.2.1", "react": "18.0.0", "react-native": "0.69.0", "react-native-gesture-handler": "^2.4.2", "react-native-pager-view": "^5.4.15", "react-native-safe-area-context": "^4.2.5", "react-native-screens": "^3.13.1", "react-native-svg": "^12.3.0", "react-native-tab-view": "^3.1.1", "react-native-vector-icons": "^9.1.0" },

I tried to downgrade/updgrade some dependencies (react and react-native in particular) but nothing works.
Also tried to clear cache from metro, gradlew...

Thanks for your help :)

Version

0.69.0

Output of npx react-native info

System:
OS: macOS 12.4
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 370.74 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.16.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.12 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 16.0.1 - /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.0 => 0.69.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

npm i
npx react-native run-android

Snack, code example, screenshot, or link to a repository

Maybe, use this configuration
"dependencies": { "@react-native-masked-view/masked-view": "^0.2.6", "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "@react-navigation/stack": "^6.2.1", "react": "18.0.0", "react-native": "0.69.0", "react-native-gesture-handler": "^2.4.2", "react-native-pager-view": "^5.4.15", "react-native-safe-area-context": "^4.2.5", "react-native-screens": "^3.13.1", "react-native-svg": "^12.3.0", "react-native-tab-view": "^3.1.1", "react-native-vector-icons": "^9.1.0" },

@JEGardner
Copy link

This probably means that, for whatever reason, React 18 is not being used despite being set in the dependencies. For me, I had resolutions set up to use React 17 in the root package.json of my lerna monorepo.

@cortinico
Copy link
Contributor

Is this happening on a fresh project?

Maybe, use this configuration

Could you provide a proper repro?

@cortinico cortinico added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jun 27, 2022
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@dcr31000
Copy link
Author

Yes, on a fresh project.

I created a new one with this versions:
"react": "17.0.2",
"react-native": "0.68.2",
and transfers all my previous development (dependencies, screens etc). It's working nice.

I got this issue only with the last version of react and/or react native. It's probably on my side.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jun 28, 2022
@ybass
Copy link

ybass commented Jun 29, 2022

Yes, on a fresh project.

I created a new one with this versions: "react": "17.0.2", "react-native": "0.68.2", and transfers all my previous development (dependencies, screens etc). It's working nice.

I got this issue only with the last version of react and/or react native. It's probably on my side.

Personally this should still be open. I have created a new project using the latest CLI and I am getting the same problem. It looks like having Expo 45 with "react-native":"^0.69.0" is causing the problem

Warning: Invalid version react-native@0.69.0 for expo sdkVersion 45.0.0. Use react-native@0.68.2

Even though using 0.68.2 has vulnerability and the recommended solution is going to 0.69.0.

The error by using 0.68.2 I get is

Severity: critical
Improper Neutralization of Special Elements used in a Command in Shell-quote - https://github.com/advisories/GHSA-g4rg-993r-mgx7
fix available via `npm audit fix --force`
Will install react-native@0.69.0, which is a breaking change
node_modules/@react-native-community/cli-tools/node_modules/shell-quote
  @react-native-community/cli-tools  4.8.0 - 5.0.0-alpha.0 || 5.0.1-alpha.0 - 6.2.0
  Depends on vulnerable versions of shell-quote
  node_modules/@react-native-community/cli-tools
    @react-native-community/cli  4.8.0 - 7.0.3
    Depends on vulnerable versions of @react-native-community/cli-hermes
    Depends on vulnerable versions of @react-native-community/cli-plugin-metro
    Depends on vulnerable versions of @react-native-community/cli-server-api
    Depends on vulnerable versions of @react-native-community/cli-tools
    node_modules/@react-native-community/cli
      react-native  <=0.0.0-ffdfbbec0 || 0.63.3 - 0.68.2
      Depends on vulnerable versions of @react-native-community/cli
      node_modules/react-native
    @react-native-community/cli-hermes  <=6.3.0
    Depends on vulnerable versions of @react-native-community/cli-tools
    node_modules/@react-native-community/cli-hermes
    @react-native-community/cli-platform-android  4.8.0 - 6.3.0
    Depends on vulnerable versions of @react-native-community/cli-tools
    node_modules/@react-native-community/cli-hermes/node_modules/@react-native-community/cli-platform-android
    @react-native-community/cli-plugin-metro  <=7.0.3
    Depends on vulnerable versions of @react-native-community/cli-tools
    node_modules/@react-native-community/cli-plugin-metro
    @react-native-community/cli-server-api  <=7.0.3
    Depends on vulnerable versions of @react-native-community/cli-tools
    node_modules/@react-native-community/cli-server-api```

@ybass
Copy link

ybass commented Jun 29, 2022

@cortinico Was hoping to get some input unless preferable to start a new issue

thank you

@cortinico
Copy link
Contributor

looks like having Expo 45 with "react-native":"^0.69.0" is causing the problem

I don't think Expo is already compatible with RN 0.69 so this is sort of expected

@AlveiroDiaz
Copy link

I have node js version 16.15.1, react-native 0.69.1 and expo 45. I'm learning to use react and only when I use es npm install -g expo-cli, it throws me many errors. Any solution?

@RamizWas
Copy link

RamizWas commented Jul 3, 2022

so what exactly is the solution to this Error?

@gpsolarco
Copy link

Facing the same issue. Please help.

@RamizWas
Copy link

RamizWas commented Jul 5, 2022

I have created a new project and it worked
would recommend trying that and going from there

@Ezulu920
Copy link

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

@spinoza1791
Copy link

spinoza1791 commented Jul 16, 2022

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

I had to do something more drastic, by upgrading react 17->18.2.0 and react-native 0.64->0.69.1, like so:
npm install react@latest react-dom@latest --force
npm audit fix --force

Changes to:
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "^0.69.1",

I was then able to run the native base typescript template

@Ezulu920
Copy link

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

Thank you, your solution worked for me when I received the error after upgrading to 0.69.1 "react": "17.0.1", "react-native": "^0.69.1",

"@types/react-native": "^0.64.5",

I'm glad it worked for you.. Happy Learning :)

@uskan
Copy link

uskan commented Jul 18, 2022

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

I had to do something more drastic, by upgrading react 17->18.2.0 and react-native 0.64->0.69.1, like so: npm install react@latest react-dom@latest --force npm audit fix --force

Changes to: "react": "^18.2.0", "react-dom": "^18.2.0", "react-native": "^0.69.1",

I was then able to run the native base typescript template

It's works for me

@Jaserto
Copy link

Jaserto commented Jul 21, 2022

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

I had to do something more drastic, by upgrading react 17->18.2.0 and react-native 0.64->0.69.1, like so: npm install react@latest react-dom@latest --force npm audit fix --force

Changes to: "react": "^18.2.0", "react-dom": "^18.2.0", "react-native": "^0.69.1",

I was then able to run the native base typescript template

I'ts works for me, thanks a lot!

@sandeeprajbhar1985
Copy link

"react": "18.2.0",

"react-native": "0.69.3",

Solved the issue for me

@jasson0802
Copy link

I think this is a version compatibility issue. When I had the same error, I downgraded to this RN version: "npm install react-native@0.68.2 --force". And it worked for me.

This worked for me. Thanks a lot!

@nandorojo
Copy link

Adding this to my package.json (at the root of my monorepo) fixed it for me:

{
  "resolutions": {
    "react": "18.0.0"
  }
}

No need to downgrade anything. You can also set that react version to any 18+ version you're using.

@zachdorcinville21
Copy link

zachdorcinville21 commented Nov 24, 2022

Still having this issue after trying all of the above solutions. I'm running an Expo 47.0.0 bare workflow and I get this error in the terminal at runtime, which causes the app to be stuck at the splash screen.

@mateoguzmana
Copy link

Adding this to my package.json (at the root of my monorepo) fixed it for me:

{
  "resolutions": {
    "react": "18.0.0"
  }
}

No need to downgrade anything. You can also set that react version to any 18+ version you're using.

Upgrading react from 17.0.2 to 18.0.0 and adding it to the resolutions worked for me

@eapunkers
Copy link

Changes to:
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "^0.69.1", it's work for me... thx a lot dude

@cortinico cortinico removed the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jan 18, 2023
@cortinico cortinico removed the Needs: Attention Issues where the author has responded to feedback. label Jan 18, 2023
hyochan added a commit to dooboolab-community/react-native-iap that referenced this issue Nov 19, 2023
## docs fixes
- improve setup of project
- remove not working scripts and urls

- I managed to get Android example app to work, but unfortunately not
the iOS, see notes bellow:

## update `IAPExample` React to `18.2.0`
    
- because of `TypeError: undefined is not an object (evaluating
'ReactCurrentActQueue$1.isBatchingLegacy')`
 - see here: facebook/react-native#34079


## iOS exampke currently not buildable because of:
- because of obsolete pods:
 ```
  $ yarn pods
rbenv: pod: command not found

The `pod' command exists in these Ruby versions:
  2.7.4
```
- see here: facebook/react-native#38921

fixed but then build failed
```
The following build commands failed:
CompileC
/Users/babu/Library/Developer/Xcode/DerivedData/IapExample-ddzasbbwninhdjgvtldlfwsnfkwf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/json.o
/Users/babu/work/powerful-medical/dev/react-native-iap/IapExample/ios/Pods/RCT-Folly/folly/json.cpp
normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target
'RCT-Folly' from project 'Pods')
(1 failure)
``` 

-> this needs more time and investigation, and the question is, is it worth the time? - anyway added warning for anybody trying to build it regarding this README

---------

Co-authored-by: hyochan <dooboolab@gmail.com>
arthurgeron pushed a commit to arthurgeron/react-native-iap that referenced this issue Jan 7, 2024
## docs fixes
- improve setup of project
- remove not working scripts and urls

- I managed to get Android example app to work, but unfortunately not
the iOS, see notes bellow:

## update `IAPExample` React to `18.2.0`
    
- because of `TypeError: undefined is not an object (evaluating
'ReactCurrentActQueue$1.isBatchingLegacy')`
 - see here: facebook/react-native#34079


## iOS exampke currently not buildable because of:
- because of obsolete pods:
 ```
  $ yarn pods
rbenv: pod: command not found

The `pod' command exists in these Ruby versions:
  2.7.4
```
- see here: facebook/react-native#38921

fixed but then build failed
```
The following build commands failed:
CompileC
/Users/babu/Library/Developer/Xcode/DerivedData/IapExample-ddzasbbwninhdjgvtldlfwsnfkwf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/json.o
/Users/babu/work/powerful-medical/dev/react-native-iap/IapExample/ios/Pods/RCT-Folly/folly/json.cpp
normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target
'RCT-Folly' from project 'Pods')
(1 failure)
``` 

-> this needs more time and investigation, and the question is, is it worth the time? - anyway added warning for anybody trying to build it regarding this README

---------

Co-authored-by: hyochan <dooboolab@gmail.com>
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

No branches or pull requests