zetachang / react-native-dotenv

A Babel preset let you import application configs from .env file (zero runtime dependency)
MIT License
915 stars 68 forks source link

react-native 0.56.0 won't bundle #44

Closed reed-jones closed 6 years ago

reed-jones commented 6 years ago

Although the build is successful, after upgrading to react-native 0.56.0 and babel-preset-react-native ^5.0.1 I get the error from Metro Bundler

Error: Cannot find module 'babel-preset-react-native-dotenv'
If you want to resolve "react-native-dotenv", use "module:react-native-dotenv"
itsyogesh commented 6 years ago

Having the same issue, I tried using module:react-native-dotenv but it shows another error.

Error: Plugin/Preset files are not allowed to export objects, only functions.
reed-jones commented 6 years ago

Theres a PR with a fix that worked for me https://github.com/zetachang/react-native-dotenv/pull/42

zetachang commented 6 years ago

Hi, v0.2.0 is released to address this 😄