Dotenv: Fails for react-native app

Created on 5 Feb 2018  路  2Comments  路  Source: motdotla/dotenv

The package at "./node_modules/dotenv/lib/main.js" attempted to import the Node standard library module "fs". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq.html#can-i-use-nodejs-packages-with-expo

Can this package be provided without dependency on NOde standard library so the it can be used with React Native also.

Most helpful comment

It took me quite a bit of painful cycles of trial and error, but I have found this package to be the .env solution that we react-native people are looking for... until everything changes a month from now, of course.

Don't bother trying to get regular dotenv to work. I have sunk down the rabbit hole, climbed back out, and have nothing but horror stories to share.

All 2 comments

no, this package purposely is focused on being used in the Node environment

It took me quite a bit of painful cycles of trial and error, but I have found this package to be the .env solution that we react-native people are looking for... until everything changes a month from now, of course.

Don't bother trying to get regular dotenv to work. I have sunk down the rabbit hole, climbed back out, and have nothing but horror stories to share.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vandivier picture Vandivier  路  3Comments

shellscape picture shellscape  路  3Comments

danawoodman picture danawoodman  路  3Comments

samayo picture samayo  路  3Comments

AndersDJohnson picture AndersDJohnson  路  4Comments