-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable usage of envalid in react-native apps #31
Enable usage of envalid in react-native apps #31
Conversation
I think this should be merged. The workaround for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the readme with RN instructions?
Right, that was missing. |
This looks good to me too– I think I had misinterpreted the latest comments on the issue's discussion. The require workarounds are ugly of course but with the comments it's clear what's going on. Thanks for the PR @Koblaid ! |
Great, thanks! |
Should be published, right? |
I'm not sure. I just tried to publish my app and when building it with the release configuration I got again errors. Seems like the package loading differs from development builds to release builds. And right now it looks like the preventing the packager from seeing the packages by obfuscating the require calls doesn't work for release builds. :-( |
Your changes in this PR has not been published |
To verify I just installed envalid from github. When I try to build the app I get the |
Right now I cannot think of a way to get it to work. Looks like it'd be the best if we would revert the commit. I could then fork envalid and replace the dependencies to get it to work. |
@Koblaid I just published v3.1, which does includes your RN changes. Could you give that a try? |
@af I just checked v3.1, the error remains the same. |
What's the error? |
This seems to work: const x = require
const fs = x('f' + 's')
const dotenv = x('doten' + 'v') Great, I didn't think that there was a solution. If it's alright with you I would verify that it's really working and prepare a PR. |
* Enable usage of envalid in react-native apps * Add chapter for React Native to README
* Enable usage of envalid in react-native apps * Add chapter for React Native to README
PR for #30
With this change I can use envalid in a react-native app if I set
dotEnvPath: null
and use a custom reporter.