I´ve been through all the docs from vite, react.js and dev blogs, but I'm not getting it to work
I have a .env file which contains the following
VITE_API_KEY = XXX
inside my firebase.js file I'm loading it like :
const firebaseConfig = {
apiKey: import.meta.env.API_KEY,
.....
.....
}
// Initialize Firebase
const app = initializeApp(firebaseConfig);
but it appears as null, I've restarted the dev server, reinstalled node_modules (just in case) changed var prefixes to REACT_APP_XX, tried using process.env.XX global object, basically gone through all different ways to read vars from a .env file in react
I´ve also tried to clog it from a component but it has the same result
any suggestions/methods to solve this problem?