Open saeid-elio opened 1 month 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/506
As mentioned on #308 this other module works straight out of the box: https://github.com/lugg/react-native-config
I have created a custom type decleration env.d.ts like this and then imported but then again, this is not a ideal solution, If any one come up with a nicer one, I'm all ears
declare module '@env' { export const GOOGLE_API_KEY: string; }
Since issue https://github.com/goatandsheep/react-native-dotenv/issues/308 is closed I'm reporting the same issue here again as I have tried all feedback there and still my error is not resolved. Note that I do not use Expo and installed my react native app using react native cli and when I run npm run android I get the following error in terminal. My Android 14 phone is connected via USB to my macbook and I also can use .env using process.env, but if I use for example
import {API_TOKEN} from '@env';
then I get the error you see below.Package.json
babel.config.js
tsconfig.json