[Bug] Uncaught TypeError: Cannot read properties of undefined (reading 'key') with terrain
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.5k
- Forks
- 1.4k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 3
Description
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
- Framework version: react-map-gl@8.0.4
- Map library: maplibre-gl@5.5.0
- Browser: Chrome 135.0.7049.42
- OS: MacOs
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100