mapbox / mapbox/mapbox-gl-js

map on error evented does not catch every tile network failures

Open
#13,494 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs information :pray:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

We're facing two main problems with Mapbox GL JS:

1. No Retry for Failed Tiles: If a tile fails to load (e.g., due to a network glitch), Mapbox doesn’t retry it. This leaves blank areas on the map even after the issue is resolved.
2. Incomplete Error Reporting: The map.on("error", ...) event doesn’t catch all tile load errors, so we can't detect or handle them properly.

**Steps to Reproduce:**

1. Load a map with vector or raster tiles.
2. Cause some tile load failures (e.g., via CORS errors or network issues).
3. Notice failed tiles stay blank and no retry happens, even after the connection is restored.
4. map.on("error", ...) is not triggered for these failures.

**Expected Behavior:**

- Failed tile loads should retry automatically or provide a way to trigger retries.
- All tile errors should trigger the error event

**Actual Behavior:**

- Failed tiles are not reloaded after temporary errors.
- Errors are not consistently reported via the event handler.

**Environment:**

Mapbox GL JS: 3.8
Browser: Chrome 137.0.7151.55 (arm64)
OS: macOS 15.0.1

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 problem in Mapbox GL JS 3.8 with vector or raster tiles, using temporary network or CORS failures as described. Trace the tile failure and map.on("error", ...) behavior; done means failed tiles retry or can be retriggered and every tile error reaches the event handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.