Quick checks
fetch.ts
const apiUrl = import.meta.env.VITE_API_URL;
if (!apiUrl) {
throw new Error('VITE_API_URL is missing');
}
const response = await fetch(apiUrl + '/health', {
method: 'GET',
credentials: 'include',
});wrong vs correct
# Wrong
https://app.example.com -> http://api.example.com
# Correct
https://app.example.com -> https://api.example.comPractical tip
This error message alone is too generic. Always inspect both browser Network panel and backend logs together.