This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
app crash if no variable present #38
Comments
This would be required for our use case too: we want developers to be able to override configuration as needed (to point to qa/staging environments, or override settings for testing) but want the app to use the prod configuration by default if no env file is present. I wonder if this can be accomplished using const {
APP_URL = 'predefined',
FOO = 'foo_default',
BAR = 'bar_default',
} = require('react-native-dotenv'); This might work since |
I had to move to another library, but I will try it soon. |
@HERRKIN what library did you move to? |
@kylethebaker I tried what you suggested as the following : const { API_BASE_URL = '' } = require('react-native-dotenv') but the Metro Bundler fails with the following :
|
Switching to |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am testing the module, I am trying to do this
APPURL || 'predefinedURL'
but if I ImportAPPURL
and it is not defined in any .env files the app crashes, I was hopping it would come empty so I could evaluate if its empty or null I could use a predifined one, now it is demanding me to use a .env file or it wont start the app at all.I even tried import env from ... ehh error I cannot import env from react native dotenv, I tried import * as env, it doesn't work either.
so I have no use for this lib at the moment.
The text was updated successfully, but these errors were encountered: