If you are using Vite, use import.meta.env
instead, process.env
is removed.
And make sure variables start with VITE_
in .env
file.
here is example
.end
file:
VITE_API_BASE_URL = http://localhost:8080/api/v1
and here service will look like:
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;