React-autobind
React-autobind copied to clipboard
Error in React-Native
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.
I'm seeing the same error.
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)
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