Skip to content

RN project fails with "Property body[6] of BlockStatement..." (Babel related issue) #31960

@wdamien

Description

@wdamien

EDIT by @kelset: this is caused by a Babel release, read more at this comment. The offending commit has been reverted, as mentioned here - so the issue is solved now. If you are still experiencing it, follow the steps described here.

PLEASE don't post comments like "same here", they only create noise


When creating a new project via npx react-native init Foo --template react-native-template-typescript, then running the default yarn ios metro throws a compile error:

error: node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js: Property body[6] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"

Tested using:

  • Typescript 3.9.4 and 4.3.5
  • React Native: 0.64.1
  • macOS 11.4
  • node v14.15.1
  • yarn 1.22.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact: RegressionDescribes a behavior that used to work on a prior release, but stopped working recently.JavaScriptResolution: FixedA PR that fixes this issue has been merged.Resolution: LockedThis issue was locked by the bot.Tech: Bundler 📦This issue is related to the bundler (Metro, Haul, etc) used.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions