fix: MarkerClusterGroup CJS interop — unwrap .default from import

react-leaflet-cluster uses exports.default instead of module.exports,
so Vite's default import resolves to {default: fn} not fn directly.
Unwrap with ?. default ?? to get the actual component function.

This was never triggered before because the MapContainer only renders
when there are GPS points — previously there were none (GPS bug).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-08-18 12:52:15 -04:00
1 parent e6e19ebaea
commit f8b32dd440
1 file changed
+2 -1
+2 -1
View File
@@ -1,6 +1,7 @@
import { useEffect, useState, useMemo, Component } from 'react';
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet';
import MarkerClusterGroup from 'react-leaflet-cluster';
import _MarkerClusterGroup from 'react-leaflet-cluster';
const MarkerClusterGroup = _MarkerClusterGroup?.default ?? _MarkerClusterGroup;
import L from 'leaflet';
import { fetchMapPhotos } from '../api/photos.js';