maplibre-gl v5 bundles reference __publicField and other esbuild
class-field helpers without defining them — a known upstream bug
(maplibre-gl-js issue #6680). Setting esbuildOptions.target and
build.target to 'esnext' tells esbuild to emit native class fields
instead of helper-based transforms, eliminating the missing symbol.
Remove all previous workaround attempts (define rewrite, globalThis
polyfill in index.html).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous index.html polyfill set window.__publicField but Vite's
dep optimizer pre-bundles in Node.js where that global is never set,
so the error persisted.
Two-part fix:
- vite.config.ts define: rewrite bare __publicField identifiers to
globalThis.__publicField (a valid entity name esbuild accepts)
- index.html: set globalThis.__publicField using the exact
Object.defineProperty signature esbuild expects, before modules run
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
esbuild's define only accepts literals/identifiers, not arrow functions.
Inject the polyfill as a plain script tag before the module entry point
so it is available when any pre-compiled dependency uses it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Migrate all three map components (Map, GoogleMap, NetworkMap) to MapLibre GL JS
- Extract shared CARTO_DARK_STYLE constants into lib/mapStyle.ts
- Move buildCircleCoords to lib/mapUtils.ts (was duplicated across components)
- Rename exports: Map → LocationMap, GoogleMap → NodeLocationMap
- Remove dead props (width, height, nightMode) from LocationMap interface
- Lazy-mount GL contexts via IntersectionObserver to prevent WebGL exhaustion
- Fix Math.spread RangeError in NetworkMap bounds calculation
- Remove showLinks conditional render in favour of visibility layout property
- Remove cursor state; set canvas cursor style directly on map interactions
- Remove Google Maps API key env vars from .env.example and .env.local
- Move Vite dev server to port 5747 (avoids cached redirect on 3000)
- Fix CORS/404: set VITE_API_BASE_URL="" so browser uses Vite proxy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>