mapbox / mapbox/mapbox-gl-js

Incompatible Type Definitions in v.3.11.0

Open
#13,441 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

types
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 3.11.0

**browser**: any
**node**: v22.14.0
**npm**: 10.9.2 / **pnpm**: 10.7.1

### Steps to Trigger Behavior

1. Build a ts project using `skipLibCheck: false`

### Link to Demonstration
https://codesandbox.io/p/devbox/nifty-alex-kc6kw6

### Expected Behavior

type definitions match and project compilation works without problems

### Actual Behavior

```
> tsc && vite build

Error: node_modules/mapbox-gl@3.11.0/node_modules/mapbox-gl/dist/mapbox-gl.d.ts(11921,2): error TS2416: Property 'loadTile' in type 'RasterArrayTileSource' is not assignable to the same property in base type 'ISource'.
Type '(tile: RasterArrayTile, callback: Callback) => void' is not assignable to type '(tile: Tile, callback: Callback, tileWorkers?: { [key: string]: Actor$1; } | undefined) => void'.
Types of parameters 'tile' and 'tile' are incompatible.
Type 'Tile' is missing the following properties from type 'RasterArrayTile': entireBuffer, requestParams, _workQueue, _fetchQueue, and 11 more.
Error: node_modules/.pnpm/mapbox-gl@3.11.0/node_modules/mapbox-gl/dist/mapbox-gl.d.ts(11922,2): error TS2416: Property 'abortTile' in type 'RasterArrayTileSource' is not assignable to the same property in base type 'ISource'.
Type '(tile: RasterArrayTile) => void' is not assignable to type '(tile: Tile, callback?: Callback | undefined) => void'.
Types of parameters 'tile' and 'tile' are incompatible.
Type 'Tile' is missing the following properties from type 'RasterArrayTile': entireBuffer, requestParams, _workQueue, _fetchQueue, and 11 more.
Error: node_modules/.pnpm/mapbox-gl@3.11.0/node_modules/mapbox-gl/dist/mapbox-gl.d.ts(11923,2): error TS2416: Property 'unloadTile' in type 'RasterArrayTileSource' is not assignable to the same property in base type 'ISource'.
Type '(tile: RasterArrayTile, _?: Callback | null | undefined) => void' is not assignable to type '(tile: Tile, callback?: Callback | undefined) => void'.
Types of parameters 'tile' and 'tile' are incompatible.
Type 'Tile' is missing the following properties from type 'RasterArrayTile': entireBuffer, requestParams, _workQueue, _fetchQueue, and 11 more.
 ELIFECYCLE  Command failed with exit code 2.
Error: Process completed with exit code 2.
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from the linked CodeSandbox with skipLibCheck set to false and run tsc followed by the Vite build. Start at node_modules/mapbox-gl/dist/mapbox-gl.d.ts lines 11921-11923, where RasterArrayTileSource conflicts with ISource. Done means the demonstrated project compiles without the TS2416 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.