[Bug] Uncaught TypeError: Cannot read properties of undefined (reading 'key') with terrain

Open
#2,539 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend, web-dev

Research direction

Start by reproducing rapid zooming or panning with the terrain source https://api.maptiler.com/tiles/terrain-rgb/tiles.json, since no sandbox is provided. Read source_cache.ts around _updateRetainedTiles and update, then follow the callers in style.ts. Done means rendering terrain no longer throws the reported TypeError during navigation.

Written by the indexing model from the issue text.

Description

bug
Description

I'm getting this error when I zoom or pan quickly and terrain is present in my style. I've tried setting maxTileCacheSize to 256 to no avail. Removing the terrain object from the style stops this from happening.
The terrain source is https://api.maptiler.com/tiles/terrain-rgb/tiles.json

framebuffer_error.ts:13 Uncaught TypeError: Cannot read properties of undefined (reading 'key')
    at be._updateRetainedTiles (source_cache.ts:750:1)
    at be.update (source_cache.ts:670:1)
    at bi._updateSources (style.ts:1654:1)
    at e.Map._render (map.ts:3291:1)
    at map.ts:3453:1
    at browser.ts:22:1
Expected Behavior

The app shouldn't crash while zooming or panning while rendering 3d features

Steps to Reproduce

I'm not able to provide a code sandbox atm

Environment
Logs

framebuffer_error.ts:13 Uncaught TypeError: Cannot read properties of undefined (reading 'key')
at be._updateRetainedTiles (source_cache.ts:750:1)
at be.update (source_cache.ts:670:1)
at bi._updateSources (style.ts:1654:1)
at e.Map._render (map.ts:3291:1)
at map.ts:3453:1
at browser.ts:22:1

Dominant language
TypeScript
Stars
8.5k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from visgl/react-map-gl

All issues in visgl/react-map-gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.