Skip to content

Doesn't work with React Native #4

@cooperka

Description

@cooperka

I got a very similar issue to #2 using React Native v0.43. After some testing, it turns out this plugin doesn't work at all with React Native :(

Property property of MemberExpression expected node to be of a type ["Identifier"] but instead got "BinaryExpression"

Working demo project: https://github.com/cooperka/DemoDevExpression

Full stack:

error: bundling: TypeError: /Users/me/dev/apps/my-app/node_modules/react-native/packager/src/Resolver/polyfills/prelude_dev.js: Property property of MemberExpression expected node to be of a type ["Identifier"] but instead got "BinaryExpression"
    at validate (/Users/me/dev/apps/my-app/node_modules/babel-types/lib/definitions/index.js:109:13)
    at Object.validate (/Users/me/dev/apps/my-app/node_modules/babel-types/lib/definitions/core.js:412:50)
    at Object.validate (/Users/me/dev/apps/my-app/node_modules/babel-types/lib/index.js:505:9)
    at NodePath._replaceWith (/Users/me/dev/apps/my-app/node_modules/babel-traverse/lib/path/replacement.js:176:7)
    at NodePath.replaceWith (/Users/me/dev/apps/my-app/node_modules/babel-traverse/lib/path/replacement.js:160:8)
    at PluginPass.enter (/Users/me/dev/apps/my-app/node_modules/babel-plugin-dev-expression/dev-expression.js:41:18)
    at newFn (/Users/me/dev/apps/my-app/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/Users/me/dev/apps/my-app/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/Users/me/dev/apps/my-app/node_modules/babel-traverse/lib/path/context.js:48:17)
TransformError: /Users/me/dev/apps/my-app/node_modules/react-native/packager/src/Resolver/polyfills/prelude_dev.js: /Users/me/dev/apps/my-app/node_modules/react-native/packager/src/Resolver/polyfills/prelude_dev.js: Property property of MemberExpression expected node to be of a type ["Identifier"] but instead got "BinaryExpression"
Bundling `index.ios.js`  100.0% (1991/1991), failed.

.babelrc:

{
  "presets": ["react-native"],
  "plugins": ["dev-expression"]
}

Any idea what's going on or how to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions