From 589acf8d3fd0a1e8af61c4f8ca29094aa57f72df Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Mon, 6 Jul 2026 15:32:47 -0500 Subject: [PATCH] Fixed @svg-maps/world interop so the stats locations map renders under Rolldown ref https://linear.app/ghost/issue/PLA-208 `@svg-maps/world` is a CJS-only data package shaped `{__esModule, default}` with no ESM build. Rolldown resolves the default import to the wrapper object rather than the map data, so `` received no locations and rendered blank. Interop-unwrapping the default fixes it and is bundler-agnostic (under Rollup the data object has no `.default`, so the fallback returns it unchanged). --- .../src/views/Stats/Locations/components/locations-card.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/stats/src/views/Stats/Locations/components/locations-card.tsx b/apps/stats/src/views/Stats/Locations/components/locations-card.tsx index 1f5bae7e249..325cacfa53b 100644 --- a/apps/stats/src/views/Stats/Locations/components/locations-card.tsx +++ b/apps/stats/src/views/Stats/Locations/components/locations-card.tsx @@ -8,6 +8,9 @@ import {STATS_LABEL_MAPPINGS, UNKNOWN_LOCATION_VALUES} from '@src/utils/constant import {SVGMap} from 'react-svg-map'; import {getPeriodText} from '@src/utils/chart-helpers'; +// `@svg-maps/world` is a CJS-only data package shaped `{__esModule, default}` with no ESM build; Rolldown returns the wrapper object, so interop-unwrap the default to get the actual map data (Rollup returns the data object unchanged). +const worldMap = (World as {default?: typeof World}).default ?? World; + countries.registerLocale(enLocale); const getCountryName = (label: string) => { return STATS_LABEL_MAPPINGS[label as keyof typeof STATS_LABEL_MAPPINGS] || countries.getName(label, 'en', {select: 'alias'}) || 'Unknown'; @@ -183,7 +186,7 @@ const LocationsCard: React.FC = ({data, isLoading, range, on