Hello Guys, How are you all? Hope You all Are Fine. Today When I am trying to run my react-native Project I am facing the following error TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” in react-native. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
- How TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error Occurs ?
- How To Solve TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error ?
- Solution 1: Copy @babel From Working Project
- Solution 2: Download @babel From Here And Paste In your Project
- Solution 3: Downgrade @babel version
- Summery
How TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error Occurs ?
I am Just trying to run my React native Project It was working fine yesterday But Today I am facing the following error.
error node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js: Property body[41] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression". Run CLI with --verbose flag for more details.
TypeError: Property body[41] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"
How To Solve TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error ?
How To Solve TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error?
To Solve TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error Here this error occurs due to @babel/core I think they just updated this package. Just copy @babel folder from node_modules of your working project and Just Paste in this project where you are facing this error. It will solve your error. Or Just Downgrade your babel version. Here is how.First of all remove the current @babel/core from the package.json Now just install older version of babel with this command. npm install –save-dev @babel/ core@7.12.9 Now you are able to run your project withou t any error.
TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression”
To Solve TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression” Error Here this error occurs due to @babel/core I think they just updated this package. Just copy @babel folder from node_modules of your working project and Just Paste in this project where you are facing this error. It will solve your error. Or Just Downgrade your babel version. Here is how.First of all remove the current @babel/core from the package.json Now just install older version of babel with this command. npm install –save-dev @babel/ core@7.12.9 Now you are able to run your project withou t any error.
Solution 1: Copy @babel From Working Project
Here this error occurs due to @babel/core I think they just updated this package. Just copy @babel folder from node_modules of your working project and Just Paste in this project where you are facing this error. It will solve your error.
- Just delete @babel folder from your node_modules folder.
- Now just Copy @babel from your working project and paste @babel to this project.
Solution 2: Download @babel From Here And Paste In your Project
- First of all Download @babel file From Here.
- Just open node_module folder of your project.
- Just delete @babel folder and paste this downloaded folder at node_modules.
- Now our error must be solved.
Solution 3: Downgrade @babel version
Just Downgrade your babel version. Here is how.
- First of all remove the current
@babel/core
from the package.json - Now just install older version of babel with this command.
- npm install –save-dev @babel/ core@7.12.9
- Now you are able to run your project withou t any error.
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also Read