mapbox-gl-js
mapbox-gl-js copied to clipboard
Getting "Type instantiation is excessively deep and possibly infinite" with Mapbox GL v3
I'm upgrading from mapbox-gl v1 to v3 which is being used in Vue3 application using Composition API and facing some issues as described in the title
Here is the code snippet for your reference
template
<div id="mapContainer" ref="mapContainer" />
script
import { Map } from 'mapbox-gl';
type MapWrapper = Map | null;
const map = ref<MapWrapper>(null);
// Initialize the map on mounted
map.value = new Map({
container: document.getElementById('mapContainer') as HTMLElement,
// [...]
});
In one of the other function, I perform null check on the map instance, but the eslint gives me the error "Type instantiation is excessively deep and possibly infinite", suggests that the type is too complex and might have circular reference.
This is an issue with Vue itself.