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

App crashes immediately on splash screen when using dotenv #73

Open sunwooz opened 4 years ago

sunwooz commented 4 years ago

I'm using expo managed app to create my application.

I was able to get an error message when using expo start --minify --no-dev but now the error message is gone and works perfectly locally.

here's the library versions in my package.json

"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-dotenv": "^0.2.0",

This is my .env file

GOOGLE_PLACES_API_KEY=mygoogleplacesapikey

This is how I'm importing the env variable.

import { GOOGLE_PLACES_API_KEY } from 'react-native-dotenv'