Skip to content

[Bug] Possible regression in v8.0.2 — Layers and sources not rendering consistently #2523

@MartinSandstrom

Description

@MartinSandstrom

Description

Hi there,

Thank you for maintaining this great library :)

After upgrading from react-map-gl@8.0.1 to 8.0.2, we’ve noticed some unexpected behavior: Certain sources and layers are not rendering reliably. In some cases, layers don’t appear, and toggling visibility on one layer can cause others (previously missing) to appear.

So far, the behavior seems inconsistent and difficult to pin down. We’ve reviewed the patch notes and commits but haven’t found any obvious changes that would explain this issue. We've also tried reproducing the problem in a minimal sandbox environment, but haven’t had any luck, possibly because we’re not yet sure what specifically is triggering it.

We have tried to lo the layers that exist in the map with map?.getStyle()?.layers; and the number of layers is different for more or less each render.

What we’ve observed:

  • Some layers fail to render initially
  • Toggling one layer may cause others to appear or disappear (different renders have different layers)
  • Reverting to 8.0.1 restores the expected behavior

Do you have any clue as to what might be causing this behavior in the latest release?

Expected Behavior

The layers should be rendered at all times and stay consistent between re-renders.

Steps to Reproduce

At the point of writing the only way I have found to reproduce this is to upgrade the version in one of our private repositories. Sorry for this.

Environment

  • Framework version: 8.0.2
  • Map library: 3.9.4
  • Browser: Chrome
  • OS: macOS

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions