I have created a .env file then I have written this code: VITE_API_URL=http://localhost:5000/api
I have applied the "VITE_API_URL" environment variable, but it gives an error. I also tried without the VITE prefix, but not remove the error.
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000/api';
The error:
Runtime Error TypeError: Cannot read properties of undefined (reading 'VITE_API_URL') "const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000/api'; export const api = { async request(endpoint: string, options: RequestInit = {}) { const url = `; at src/lib/api.ts:1:38 Bun v1.2.20
