React native: Error “Unexpected identifier ‘_classCallCheck’.import call expects exactly one argument”

We Are Going To Discuss About React native: Error “Unexpected identifier ‘_classCallCheck’.import call expects exactly one argument”. So lets Start this Android Article.

React native: Error “Unexpected identifier ‘_classCallCheck’.import call expects exactly one argument”

How to solve React native: Error “Unexpected identifier ‘_classCallCheck’.import call expects exactly one argument”

I had the same problem and the steps above didn’t work, so i update metro-react-native-babel-preset from 0.56.0 to 0.59.0 and it worked.

React native: Error “Unexpected identifier ‘_classCallCheck’.import call expects exactly one argument”

I had the same problem and the steps above didn’t work, so i update metro-react-native-babel-preset from 0.56.0 to 0.59.0 and it worked.

Solution 1

I had the same problem and the steps above didn’t work, so i update metro-react-native-babel-preset from 0.56.0 to 0.59.0 and it worked.

Original Author Pietro Paolo Of This Content

Solution 2

Thank God after days of work this silly issue resolved on my side

In my case it was babel, actually i removed the yarn.lock file and after a fresh yarn the babel version was updated so its creating this issue, so what i did i just revert the yarn.lock file and remove ( ^ ) from “@babel/core” version and did a yarn and then it works….

my current babel/core version is “@babel/core”: “7.12.9”,

i changed this

“@babel/core”: “^7.12.9”,

to this

“@babel/core”: “7.12.9”,

this issue also listed here

Original Author Arslan Bajwa Of This Content

Solution 3

"@babel/core": "7.12.0", // was "7.9.6"
"metro-react-native-babel-preset": "0.59.0", // was "0.58.0"

This helped me (RN 0.62.2)

Original Author Иван Иванов Of This Content

Solution 4

1.in your terminal enter:

npm ls metro-config

you will see your version of react-native need the version of metro-config

  1. change the version of these dependencies:
    "metro": "^0.59.0",
    "metro-core": "^0.59.0",
    "metro-react-native-babel-preset": "^0.59.0",
  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules and run yarn install
  3. Reset Metro’s cache by passing the –reset-cache flag, or adding
  4. resetCache: true to your metro configuration file.
  5. Remove the cache: rm -rf ${TMPDIR:-/tmp}/metro-*
  6. if necessary add
      resetCache: true,

in your metro.config.js

Original Author leooooooo Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment