close

[Solved] TypeError: Property body[41] of BlockStatement expected node to be of a type [“Statement”] but instead got “AssignmentExpression”

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 ?

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 ?

  1. 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/ [email protected] Now you are able to run your project withou t any error.

  2. 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/ [email protected] 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.

  1. Just delete @babel folder from your node_modules folder.
  2. 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

  1. First of all Download @babel file From Here.
  2. Just open node_module folder of your project.
  3. Just delete @babel folder and paste this downloaded folder at node_modules.
  4. Now our error must be solved.

Solution 3: Downgrade @babel version

Just Downgrade your babel version. Here is how.

  1. First of all remove the current @babel/core from the package.json
  2. Now just install older version of babel with this command.
  3. npm install –save-dev @babel/ [email protected]
  4. 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

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment