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

mapbox-gl-geocoder not compatible with [email protected]

Open jeremy-wl-app-lite opened this issue 1 year ago • 8 comments

I'm migrating my project to mapbox-gl 3.5.1 but have hit a blocker

"dependencies": { "@mapbox/mapbox-gl-geocoder": "^5.0.2", "mapbox-gl": "^3.5.1", ... }, "devDependencies": { "@types/mapbox__mapbox-gl-geocoder": "^5.0.0", // I've tried building my project with this typing included as well as excluded }

When included, I get many errors. Here's 2 examples:

Example 1: Error: node_modules/mapbox-gl/dist/mapbox-gl.d.ts:8293:2 - error TS2416: Property 'tileID' in type 'ImageSource' is not assignable to the same property in base type 'ISource'. Type 'CanonicalTileID | null | undefined' is not assignable to type 'CanonicalTileID | undefined'. Type 'null' is not assignable to type 'CanonicalTileID | undefined'.

8293 tileID: CanonicalTileID | null | undefined;

Example 2: Error: node_modules/@types/mapbox__mapbox-gl-geocoder/index.d.ts:270:40 - error TS2694: Namespace '"C:/Users/.../app/node_modules/mapbox-gl/dist/mapbox-gl"' has no exported member 'FlyToOptions'.

270 setFlyTo(flyTo: boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions): this;

When excluded, I get many different errors. Here are examples:

Example 1: Could not find a declaration file for module '@mapbox/mapbox-gl-geocoder'. 'c:/Users/.../app/node_modules/@mapbox/mapbox-gl-geocoder/lib/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/mapbox__mapbox-gl-geocoder if it exists or add a new declaration (.d.ts) file containing declare module '@mapbox/mapbox-gl-geocoder';ts(7016)

Example 2: Error: src/app/services/map/layers/conditions.service.ts:238:133 - error TS2503: Cannot find namespace 'GeoJSON'.

238 private _getClosestFeature(point: LngLat, features: (GeoJSON.Feature & { geometry: { coordinates: [ number, number ][] } })[]): GeoJSON.Feature & { geometry: { coordinates: [ number, number ][] } } {

jeremy-wl-app-lite avatar Jul 10 '24 16:07 jeremy-wl-app-lite

Same here!

manuelpoelzl avatar Aug 04 '24 20:08 manuelpoelzl

Any updates here?

utsabc avatar Aug 11 '24 07:08 utsabc

Buen día, tengo el mismo problema:

image

Tal vez la versión mapbox-gl mayor a [3.5.1] ya no existe el type FlyToOptions, ya sea por alguna actualización

image

Cualquier aporte sería de útil para resolver Gracias.

JavierRomualdo avatar Sep 01 '24 21:09 JavierRomualdo

same issue @JavierRomualdo is this issue you fixed?

Rubanrubi avatar Sep 04 '24 05:09 Rubanrubi

This is the temporary solution currently i solved this by the below versions strictly installed version. @JavierRomualdo

"dependencies": { "@mapbox/mapbox-gl-geocoder": "5.0.2", "mapbox-gl": "3.0.1", "ngx-mapbox-gl": "10.0.0", },

"devDependencies": { "@types/mapbox__mapbox-gl-geocoder": "5.0.0", "@types/mapbox-gl": "2.7.19", }

Rubanrubi avatar Sep 04 '24 06:09 Rubanrubi

Another temporary solution is to disable the lib check in TypeScript's config. Just add the following line "skipLibCheck": true to compilerOptions.

ykulynych avatar Sep 25 '24 09:09 ykulynych

mapbox-gl is already at 3.8.0, yet this package is still not compatible with that latest version of mapbox-gl?

daryllmoya avatar Nov 19 '24 12:11 daryllmoya

mapbox-gl is already at v3.16.0. There are numerous type incompatibilities. Is this library no longer maintained? 🤔

williamrjribeiro avatar Nov 10 '25 16:11 williamrjribeiro