Skip to content
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

Env variables undefined with expo 48 #415

Closed
elitenas opened this issue Feb 20, 2023 · 5 comments · Fixed by #417
Closed

Env variables undefined with expo 48 #415

elitenas opened this issue Feb 20, 2023 · 5 comments · Fixed by #417
Assignees

Comments

@elitenas
Copy link

Hi,

After upgrading to expo 48, environment variables come undefined on the mobile app but work fine on react-native-web with expo.

I am using babel-loader 9.x.x with expo 48 due to expo 48 upgrading to webpack 5

I have tried .env .env.local .env.production.local and .env.production all are returning me undefined

@github-actions
Copy link

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/415

@goatandsheep
Copy link
Owner

goatandsheep commented Feb 21, 2023

Test repo: https://github.com/goatandsheep/react-native-dotenv-expo-test

To test

  • expo 48 with babel-loader 8.x.x android production

Tested and working

  • expo 48 with babel-loader 8.x.x web production
  • expo 48 with babel-loader 9.x.x web production
  • expo 48 with babel-loader 9.x.x android production
  • expo 48 with babel-loader 9.x.x android development

@goatandsheep
Copy link
Owner

this is my start script:

"start:npx-dev": "NODE_ENV=development&& npx expo start --clear"

Other info on variants in expo:

@goatandsheep
Copy link
Owner

goatandsheep commented Feb 21, 2023

if you're using another way to configure your NODE_ENV you're going to have to figure it out yourself unless there's a bounty

@goatandsheep
Copy link
Owner

relevant

goatandsheep added a commit that referenced this issue Feb 24, 2023
* readme updates + commonjs issue

* make order dotenv-flow

* cleanup

* 3.4.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants