Map tiles broken in prod: NEXT_PUBLIC_MAP_TILE_URL build-arg never set in CI #117

Closed
opened 2026-09-07 18:39:41 -04:00 by logan · 1 comment
Owner

Every map surface (/ Live, /incidents/[id] detail) renders full-screen API KEY REQUIRED / carto.com/basemaps watermarks instead of tiles. basemaps.cartocdn.com now requires an apikey (or is rate-limiting our origin). The map is the product centerpiece and is currently illegible.

Cause: components/MapView.tsx was changed this session to process.env.NEXT_PUBLIC_MAP_TILE_URL || "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png", but NEXT_PUBLIC_MAP_TILE_URL was never added to the frontend build args in .gitea/workflows/deploy.yml. Firebase public config is baked at CI build time via build-args; this var needs the same treatment. Prod bundle therefore still ships the dead Carto URL (attribution still reads © CARTO).

Fix: add NEXT_PUBLIC_MAP_TILE_URL as a build-arg in the frontend image build step, value e.g. https://tile.openstreetmap.org/{z}/{x}/{y}.png (raster, no {s}/{r}) or a keyed provider, then redeploy. Code side already reads it.

Found in live audit 2026-09-07, Version 5C/UI_AUDIT_0907b.md finding 1. Relates to #109.

Every map surface (`/` Live, `/incidents/[id]` detail) renders full-screen `API KEY REQUIRED` / `carto.com/basemaps` watermarks instead of tiles. `basemaps.cartocdn.com` now requires an apikey (or is rate-limiting our origin). The map is the product centerpiece and is currently illegible. **Cause:** `components/MapView.tsx` was changed this session to `process.env.NEXT_PUBLIC_MAP_TILE_URL || "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"`, but `NEXT_PUBLIC_MAP_TILE_URL` was **never added to the frontend build args in `.gitea/workflows/deploy.yml`**. Firebase public config is baked at CI build time via build-args; this var needs the same treatment. Prod bundle therefore still ships the dead Carto URL (attribution still reads `© CARTO`). **Fix:** add `NEXT_PUBLIC_MAP_TILE_URL` as a build-arg in the frontend image build step, value e.g. `https://tile.openstreetmap.org/{z}/{x}/{y}.png` (raster, no `{s}`/`{r}`) or a keyed provider, then redeploy. Code side already reads it. Found in live audit 2026-09-07, `Version 5C/UI_AUDIT_0907b.md` finding 1. Relates to #109.
Author
Owner

CI build-arg added on branch fix/117-map-tile-build-arg (local commit fe64392, pending push/PR/deploy).

.gitea/workflows/deploy.yml "Build & push frontend" step now passes NEXT_PUBLIC_MAP_TILE_URL=https://tile.openstreetmap.org/{z}/{x}/{y}.png alongside the Firebase/C2 build-args, so the var is baked into the Next bundle at CI build time like the rest of the public config. The {z}/{x}/{y} Leaflet placeholders are literal in the YAML.

Separately, the MapView.tsx fallback URL is being switched from Carto to OSM on the #118 branch so prod recovers from the "API KEY REQUIRED" watermarks even before this workflow change deploys.

CI build-arg added on branch `fix/117-map-tile-build-arg` (local commit fe64392, pending push/PR/deploy). `.gitea/workflows/deploy.yml` "Build & push frontend" step now passes `NEXT_PUBLIC_MAP_TILE_URL=https://tile.openstreetmap.org/{z}/{x}/{y}.png` alongside the Firebase/C2 build-args, so the var is baked into the Next bundle at CI build time like the rest of the public config. The `{z}/{x}/{y}` Leaflet placeholders are literal in the YAML. Separately, the `MapView.tsx` fallback URL is being switched from Carto to OSM on the #118 branch so prod recovers from the "API KEY REQUIRED" watermarks even before this workflow change deploys.
logan closed this issue 2026-09-07 19:06:22 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/server-26#117