[Bug] Frontend code references process.env instead of Vite import.meta.env #2

Open
opened 2026-10-14 09:43:32 +00:00 by indrajeet · 0 comments

Summary

Client-side code in frontend/src/services/api.ts, frontend/src/features/auth/LoginView.tsx, and frontend/src/features/auth/CallbackView.tsx uses Node's process.env.VITE_* rather than Vite's standard import.meta.env.VITE_*.

Impact

  • tsc fails with TS2580: Cannot find name 'process' because @types/node is not installed.
  • In production Vite bundles, process is undefined in browser environments, throwing runtime ReferenceError: process is not defined.
  • Missing src/vite-env.d.ts prevents IDE and TypeScript type-checking for Vite client variables.

Expected Behavior

  • Client code must access environment variables via import.meta.env.VITE_*.
  • src/vite-env.d.ts should declare ImportMetaEnv and reference vite/client.
### Summary Client-side code in `frontend/src/services/api.ts`, `frontend/src/features/auth/LoginView.tsx`, and `frontend/src/features/auth/CallbackView.tsx` uses Node's `process.env.VITE_*` rather than Vite's standard `import.meta.env.VITE_*`. ### Impact - `tsc` fails with `TS2580: Cannot find name 'process'` because `@types/node` is not installed. - In production Vite bundles, `process` is undefined in browser environments, throwing runtime `ReferenceError: process is not defined`. - Missing `src/vite-env.d.ts` prevents IDE and TypeScript type-checking for Vite client variables. ### Expected Behavior - Client code must access environment variables via `import.meta.env.VITE_*`. - `src/vite-env.d.ts` should declare `ImportMetaEnv` and reference `vite/client`.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: prashant/c_agri_trade_code#2
No description provided.