I am currently loading Google Maps JavaScript MarkerClusterer from CDN. I am trying to switch to the NPM version (to get some Typescript checking in my JavaScript files), but I do not understand how. The documentation seems to assume I do understand how. It just says I should use this line after installing the NPM version:
import { MarkerClusterer } from "@googlemaps/markerclusterer";
But Google Chrome disagrees and says
Uncaught TypeError: Failed to resolve module specifier "@googlemaps/markerclusterer". Relative references must start with either "/", "./", or "../".
What can I do to resolve this error?
you need to install
npm i @googlemaps/markerclusterer -D