Description
The getOrgBlastRadius function references VITE_API_URL instead of VITE_API_BASE_URL, causing silent fetch failures in any non-default deployment. Every other API function uses the centralized API_BASE constant, but this one function hardcodes a different env var name that is never set anywhere.
Actual Behavior
Every other API function uses API_BASE:
frontend/src/app/lib/api.ts (lines 1-3):
export const API_BASE =
import.meta.env.VITE_API_BASE_URL?.replace(/\/$/, "") ||
"http://localhost:8000";
Blast radius uses wrong env var:
frontend/src/app/lib/api.ts (lines 352-360):
export async function getOrgBlastRadius(orgJobId: string) {
const baseUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000'; // ← WRONG VAR
const response = await fetch(`${baseUrl}/api/scans/org/${orgJobId}/blast-radius`);
// ...
}
.env only defines the correct var:
VITE_API_BASE_URL=http://localhost:8000
VITE_API_URL is never defined anywhere in the codebase.
The blast radius graph component calls this function:
frontend/src/app/components/blast-radius-graph.tsx (lines 78-79):
const data = await getOrgBlastRadius(orgJobId); // ← silently fails in production
Impact
- In any deployment behind a reverse proxy, Docker network, or custom port, the blast radius graph silently breaks
- The feature shows "Failed to load dependency graph" with no indication of why it fails while all other features work
- A key differentiating feature of the org scan workflow is non-functional in production
Expected Behavior
All API functions must use the same centralized API_BASE constant for consistent behavior across deployments.
Proposed Fix
api.ts: Change getOrgBlastRadius to use API_BASE instead of import.meta.env.VITE_API_URL
- Remove the dead
VITE_API_URL reference entirely
- Verify no other functions have similar env var mismatches
Description
The
getOrgBlastRadiusfunction referencesVITE_API_URLinstead ofVITE_API_BASE_URL, causing silent fetch failures in any non-default deployment. Every other API function uses the centralizedAPI_BASEconstant, but this one function hardcodes a different env var name that is never set anywhere.Actual Behavior
Every other API function uses
API_BASE:frontend/src/app/lib/api.ts(lines 1-3):Blast radius uses wrong env var:
frontend/src/app/lib/api.ts(lines 352-360):.envonly defines the correct var:VITE_API_URLis never defined anywhere in the codebase.The blast radius graph component calls this function:
frontend/src/app/components/blast-radius-graph.tsx(lines 78-79):Impact
Expected Behavior
All API functions must use the same centralized
API_BASEconstant for consistent behavior across deployments.Proposed Fix
api.ts: ChangegetOrgBlastRadiusto useAPI_BASEinstead ofimport.meta.env.VITE_API_URLVITE_API_URLreference entirely