In Vite you should use import.meta.env and not process.env because it will run in the browser.
import.meta.env
process.env
Example :
console.log('API URL:', import.meta.env.VITE_API_URL);