React-autobind icon indicating copy to clipboard operation
React-autobind copied to clipboard

Error in React-Native

Open ColinRTaylor opened this issue 8 years ago • 3 comments

Wasn't sure where to post this question, but I'm getting an error with React-Native:

`[node-haste] Encountered an error while persisting cache:

ReferenceError: [BABEL] /node_modules/react-autobind/index.js: Unknown option: /node_modules/react/react.js.Children`

Any idea about this? Happy to contribute if I can figure out how what this means.

ColinRTaylor avatar Jun 22 '16 20:06 ColinRTaylor

I'm seeing the same error.

eysi09 avatar Jul 19 '16 14:07 eysi09

Just hit this myself, and fixed it by deleting the .babelrc file. (I guess because react-native doesn't import a full version of the react babel transpiling module--or maybe it just uses a different version of the module)

@cassiozen Any idea how to have this work by default for both react and react-native? If you don't know a way, the Readme should probably at least mention the above react-native fix. (after that fix it works fine)

Venryx avatar Dec 23 '16 10:12 Venryx

This error exists for any dependency in node_modules that includes a .babelrc

See https://github.com/matc4/react-native-svg-uri/issues/62 for another example of this behaviour and https://github.com/airbnb/react-with-styles/issues/44#issuecomment-278434949 for a hacky fix (postinstall script that removes all .babelrc files)

Also see https://github.com/facebook/react-native/issues/10966 for the issue that may track its eventual fix

edmofro avatar Jul 20 '17 00:07 edmofro