mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Getting "Type instantiation is excessively deep and possibly infinite" with Mapbox GL v3

Open smg-kayle opened this issue 1 year ago • 1 comments

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.

Image

smg-kayle avatar Oct 29 '25 06:10 smg-kayle

This is an issue with Vue itself.

smg-kayle avatar Oct 29 '25 07:10 smg-kayle