Closed adamivancza closed 6 years ago
Thanks @adamivancza! Would be great if we could get this rolled into master as I'm getting the same errors.
while we're waiting for the merge you can reference my fork directly:
"react-native-dotenv": "https://github.com/adamivancza/react-native-dotenv"
@adamivancza I tried your branch, but I am still getting the same error.
@ashishmusale did you run npm install
then restart your packager?
Yes, I did. I deleted node_modules and ran npm install
Simple and excellent @adamivancza. Appreciate it!
Think we can get this one merged into master? Great fix @adamivancza !
Don't forget to update your .babelrc
file @ashishmusale
@zetachang can we get this in?
Hey guys, thank you for working on this, I am looking into it and see if I could merge this and release a new version this weekend. 💪
Thanks @zetachang !
like @ashishmusale I still have the issues mentioned above.
If you're on react-native@0.56.0
, things to consider:
cat yarn.lock | grep react-native-dotenv
in your Terminal to see what's actually being resolved in your project. The result should look like:react-native-dotenv@^0.2.0:
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-0.2.0.tgz#311551cb6a35a3dcfede648bded55c0e3ece579d"
"react-native-dotenv": "^0.2.0",
in your package.json
, then, in Terminal, run:watchman watch-del-all
killall -9 node
rm yarn.lock
yarn
yarn.lock
file in terms of what react-native-dotenv
resolves to..babelrc
file's "presets"
line looks similar to:
"presets": ["react-native", "module:react-native-dotenv"],
I got two errors when I tried to run my project with RN 0.56.0-rc.2:
error: bundling failed: Error: Cannot find module 'babel-preset-react-native-dotenv' from 'project'
If you want to resolve "react-native-dotenv", use "module:react-native-dotenv"
error: bundling failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In project/node_modules/react-native-dotenv/index.js