tonyghouse
Unable to read env variables in react vite project (build using Dockerfile)
//.env file
VITE_DUMMY_KEY_1=1000
VITE_DUMMY_KEY_2=$PORT
VITE_DUMMY_KEY_3=${PORT}
VITE_DUMMY_KEY_4=${{PORT}}
//checking by logging the keys
const k1 = import.meta.env.VITE_DUMMY_KEY_1;
console.log("k1::: ",k1);
const k2 = import.meta.env.VITE_DUMMY_KEY_2;
console.log("k2::: ",k2);
const k3 = import.meta.env.VITE_DUMMY_KEY_3;
console.log("k3::: ",k3);
const k4 = import.meta.env.VITE_DUMMY_KEY_4;
console.log("k4::: ",k4);
42 replies