Replies: 1 comment
-
The issue was I had only Sentry env variables defined in eas.json. From Expo SDK 48.0.21 and above it was used instead of the .env file. After adding all to the eas.json file, everything is working. I'm closing this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Discussed in #465
Originally posted by benazir46 October 14, 2023
I use a private package that uses environment variables. After upgrading to Expo SDK 49 from 48, they are not working properly in standalone builds. I'm accessing env variables like process.env.MY_VARIABLE. It works inside the src folder, but it's not working inside the node_modules folder where my private package lies. Expo SDK 49 supports environment variables starting with the prefix EXPO_PUBLIC_. Expo mentioned it does not change anything inside the node_modules folder for security reasons, so I was hoping this library could help. I have been using this library for the last five years without any trouble till now.
I'm also using Sentry. It needs environment variables too. In Expo SDK 48 I had issues with it: Sentry package wasn't able to access the env vars. The way I got around with was by updating the babel configuration like this:
plugins: [ [ 'module:react-native-dotenv', { moduleName: 'react-native-dotenv', path: '.env.custom', allowUndefined: false, }, ], ]
Now it's not working. Could this be due to the eas-cli? My current version is `eas-cli/5.4.0 darwin-x64 node-v16.19.1`
To reproduce this you need to use Sentry and install a private package that uses env variables. Then check the env variable values inside the node_modules folder on the standalone build. Here is my expo environment info:
expo-env-info 1.0.5 environment info:
Beta Was this translation helpful? Give feedback.
All reactions