Open AyoCodess opened 9 months ago
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/487
Reinstall as devDependency
Reinstall as devDependency
Thanks for getting back to me. This is my package.json. I get the same error.
when i run eas build --local
for ios. in the eas cli, it says no env are loaded, as it needs to read these from the eas.json. but i do not want to put api keys obviously in there as plain-text.
i have the same error when running the build uisng eas services
{
"name": "mobile",
"version": "1.0.1",
"main": "index.js",
"scripts": {
"start": "expo start",
"droid": "expo start --android -c ",
"ios": "expo start --ios -c",
"web": "expo start --web",
},
"dependencies": {
"@clerk/clerk-expo": "^0.19.27",
"@expo/config": "~8.5.0",
"@hookform/resolvers": "^3.3.3",
"@react-native-async-storage/async-storage": "^1.21.0",
"@repo/api": "*",
"@repo/auth": "*",
"dayjs": "^1.11.10",
"expo": "^50.0.4",
"expo-constants": "~15.4.5",
"expo-crypto": "~12.8.0",
"expo-dev-client": "~3.3.7",
"expo-linking": "~6.2.2",
"expo-router": "~3.4.7",
"expo-secure-store": "~12.8.1",
"expo-status-bar": "~1.11.1",
"expo-updates": "~0.24.9",
"expo-web-browser": "~12.8.2",
"nativewind": "^4.0.16",
"react": "18.2.0",
"react-hook-form": "^7.49.2",
"react-native": "0.73.2",
"react-native-calendars": "^1.1303.0",
"react-native-dropdown-select-list": "^2.0.5",
"react-native-gesture-handler": "~2.14.0",
"react-native-get-random-values": "^1.10.0",
"react-native-gifted-charts": "^1.4.7",
"react-native-pager-view": "^6.2.3",
"react-native-progress": "^5.0.1",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-toast-message": "^2.2.0",
"superjson": "2.2.1",
"zod": "^3.22.4",
"zustand": "^4.5.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@expo/config-plugins": "~7.8.0",
"@repo/eslint-config": "*",
"@repo/prettier-config": "*",
"@repo/tailwind-config": "*",
"@repo/typescript-config": "*",
"@types/node": "^20.11.19",
"@types/react": "~18.2.14",
"react-native-dotenv": "^3.4.9",
"@types/react-native-dotenv": "^0.2.2",
"@types/react-native-get-random-values": "^1.8.2",
"tailwind": "^4.0.0",
"typescript": "^5.1.3"
},
"private": true,
"eslintConfig": {
"root": true,
"extends": [
"@repo/eslint-config/react"
],
"ignorePatterns": [
"expo-plugins/**"
]
}
}
added new images.
Is this relevant: https://docs.expo.dev/guides/environment-variables/#how-to-read-from-environment-variables
@AyoCodess unfortunately no it's not particularly relevant. It's a separate way of loading environment variables that works quite well. You may be able to use that method instead of this library altogether. I haven't tried it out myself though so if you do, please let me know! Thank you for confirming it's a devDependency. I'll check it off in your issue description. Do you have a env.d.ts file? If you have an example repo of this not working it helps me tremendously as I can pinpoint exactly where the issue may be :)
@AyoCodess unfortunately no it's not particularly relevant. It's a separate way of loading environment variables that works quite well. You may be able to use that method instead of this library altogether. I haven't tried it out myself though so if you do, please let me know! Thank you for confirming it's a devDependency. I'll check it off in your issue description. Do you have a env.d.ts file? If you have an example repo of this not working it helps me tremendously as I can pinpoint exactly where the issue may be :)
I'll create one.
any solution? i'm facing the same problem, i've tried everything, no success.
Describe the bug envs are not defined in local build process.
To Reproduce Steps to reproduce the behavior: local builds
Expected behavior env should be loaded into build process
Screenshots edit: (IM USING EXPOPUBLIC)
Desktop (please complete the following information): Mac book pro
Additional context My app picks up the envs while developing just fine. it only failed when i build the app.
am i missing something in my set up?
works as expected during development.
import { EXPO_PUBLIC_CONVEX_URL, EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY } from "@env";