mapbox / mapbox/mapbox-gl-js

Unhelpful warning message for 'Unable to perform style diff'

Open
#6,933 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: 0.45.0

**browser**: Google Chrome

### Steps to Trigger Behavior

1.Load https://jsfiddle.net/3s8gdhwr/
2.Open **Dev Tools**

*Outcome:* You will get an unhelpful warning message. Now, remove **interactive** property from any layer, warning goes away.

It's great that the style is being diff'ed, it would be really nice if the warning could lead you to the actual culprit, it is the message that could be improved.

`Unable to perform style diff: Unimplemented: setLayerProperty, setLayerProperty.. Rebuilding the style from scratch`.

Okay, good to be warned, but **what am I being warned about?**, I took it that mapbox have yet to implement the `setLayerProperty` function, but that was completely wrong. In my case, the root cause of the warning was, an obsolete layer property (**interactive**) was being set, Why not say that, at least identify the property/value being set, then the developer can check if that property value is valid, against the spec. It might even be better to just output the full command that failed.

### Link to Demonstration

https://jsfiddle.net/3s8gdhwr/

### Expected Behavior

### Actual Behavior

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 warning from the linked JSFiddle by opening Chrome DevTools and removing the interactive property from a layer to compare the behavior. Trace the style-diff warning from the reported "Unable to perform style diff" message, then verify that the warning identifies the invalid property or operation and remains understandable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.