Closed ethantran closed 7 years ago
Hmm, hard to say but at a glance it seems likely that this is an issue with React Native or with your Babel/bundling setup. Are you not excluding node_modules from being parsed with Babel?
If you can share a branch or more details of your setup I can take a closer look.
Sure I am using expo. I will try with create-react-native-app next. https://github.com/ethantran/react-native-examples
crna does not work either by default. I fixed it on crna by npm install babel-plugin-add-module-exports --save-dev
and adding "add-module-exports",
to .babelrc. These steps do not work on an expo project however. I get another error "Couldn't find preset "env" relative to directory"
I guess I will transfer my code to crna, but is modifying by babelrc to use add module exports really the best way to fix this? I would prefer a way to use flubber without changing the default babel configs for expo or crna
Yeah, I agree that's not ideal but I think this is a question for the Babel folks. Seems like a misconfiguration somewhere in the process, since I would think that by default you wouldn't want to activate the babel configs of node_modules
packages when bundling them.
Closing this, if you hear otherwise from the Babel folks feel free to reopen.
Forgot about this. I just ignored the flubber folder in my babel config instead installing it in my previous post.
"ignore": [ "node_modules/flubber" ]
I get this error with React Native.
Building JavaScript bundle: error TransformError: /Users/RONIN/ReactNativeProjects/react-native-examples/node_modules/flubber/build/flubber.min.js: Unknown plugin "add-module-exports" specified in "/Users/RONIN/ReactNativeProjects/react-native-examples/node_modules/flubber/package.json" at 0, attempted to resolve relative to "/Users/RONIN/ReactNativeProjects/react-native-examples/node_modules/flubber"