Vite ENVs not being read once deployed
gee
FREEOP

17 days ago

Im using React Router (Formerly RemixJS) for a frontend app i have. Using VITE to manage my envs. VITE envs are only avaible are build time and not run time. Even though i have specified the env in my railway as well as rebuilt. At deployment runtime my app cannot detect the variables.

const response = await fetch(`${import.meta.env.VITE_VIO_API_URL || 'http://localhost:8000'}/files/parse`, { method: 'POST', body: formData, // Don't set Content-Type header for FormData, let browser set it });

This is a snippet, at deployment we always fallback to the localhost route.

0 Replies

Loading...