-
Notifications
You must be signed in to change notification settings - Fork 180
Open
Description
Hi, this code:
import * as mapboxmapboxGlGeocoder from 'https://esm.run/@mapbox/mapbox-gl-geocoder';
console.log(mapboxmapboxGlGeocoder)will raise the following error:
Uncaught TypeError: Cannot read properties of null (reading 'nanoid')
at events.js:2:32
So, the package is not importable at all. As far as I can tell, the issue seems to be that if i go to https://cdn.jsdelivr.net/npm/[email protected]/+esm, it gives no default export (export default null), whereas the Mapbox package is set to import s from"/npm/[email protected]/+esm" and then does s.nanoid and that's null. So, I believe the solution would be instead to:
import { nanoid } from"/npm/[email protected]/+esm"and to rely on the specific export rather than the default export.
Thanks so much!
triplesnap
Metadata
Metadata
Assignees
Labels
No labels