mapbox / mapbox/mapbox-gl-js

Console warning when using terrain with custom styles in v3.1.0+

Open
#13,059 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: 3.1.2
**browser**: Chrome 120.0.6099.225

Works as expected in version 3.0.1. Warning appears in version 3.1.0+.

### Steps to Trigger Behavior

1. Create a new style in Mapbox Studio
2. Select Mapbox Standard
3. Go to Global -> 3D Terrain
4. Enable terrain -> On
5. Use the style as the _style_ parameter when drawing the map

### Expected Behavior
No warnings in the console.

### Actual Behavior
A warning appears in the console:
```
Couldn't find terrain source "mapbox-dem".

warnOnce @ mapbox-gl-unminified.js:1096
update @ mapbox-gl-unminified.js:57581
updateTerrain @ mapbox-gl-unminified.js:63949
_updateTerrain @ mapbox-gl-unminified.js:78237
_render @ mapbox-gl-unminified.js:78000
eval @ mapbox-gl-unminified.js:78359
requestAnimationFrame (async)
frame @ mapbox-gl-unminified.js:2677
_triggerFrame @ mapbox-gl-unminified.js:78354
triggerRepaint @ mapbox-gl-unminified.js:78349
_update @ mapbox-gl-unminified.js:77905
eval @ mapbox-gl-unminified.js:75276
fire @ mapbox-gl-unminified.js:2910
fire @ mapbox-gl-unminified.js:2920
_load @ mapbox-gl-unminified.js:66157
eval @ mapbox-gl-unminified.js:65980
eval @ mapbox-gl-unminified.js:1596
Promise.then (async)
finishRequest @ mapbox-gl-unminified.js:1584
eval @ mapbox-gl-unminified.js:1571
Promise.then (async)
validateOrFetch @ mapbox-gl-unminified.js:1568
makeFetchRequest @ mapbox-gl-unminified.js:1605
makeRequest @ mapbox-gl-unminified.js:1660
getJSON @ mapbox-gl-unminified.js:1670
loadURL @ mapbox-gl-unminified.js:65974
_updateStyle @ mapbox-gl-unminified.js:76501
setStyle @ mapbox-gl-unminified.js:76481
Map @ mapbox-gl-unminified.js:75233
```

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

The report identifies updateTerrain and _updateTerrain in the console stack; trace those entry points in the TypeScript source and compare behavior between 3.0.1 and 3.1.2. Reproduce with a Mapbox Studio style using Mapbox Standard and 3D Terrain, then confirm the console warning is absent without changing expected terrain behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.