Description
The frontend relies on NEXT_PUBLIC_API_BASE_URL being set at build time, but if it is missing the app silently makes requests to undefined which produces confusing network errors.
Add a startup check that validates all required public env vars and throws a clear error during build if any are missing.
Deliverables
Notes
No new dependencies needed — plain TypeScript is fine. Do not use zod unless it is already in the project dependencies.
Description
The frontend relies on
NEXT_PUBLIC_API_BASE_URLbeing set at build time, but if it is missing the app silently makes requests toundefinedwhich produces confusing network errors.Add a startup check that validates all required public env vars and throws a clear error during build if any are missing.
Deliverables
lib/env.tsthat reads and validates required env vars (NEXT_PUBLIC_API_BASE_URL,NEXT_PUBLIC_STELLAR_NETWORK)Missing required env var: NEXT_PUBLIC_API_BASE_URLlib/api-client.tsso it fails at module load time, not silently at runtime.env.examplefile atnevo_frontend/listing all required vars with placeholder valuesnpm run buildstill passes with the vars presentNotes
No new dependencies needed — plain TypeScript is fine. Do not use
zodunless it is already in the project dependencies.