visgl / visgl/react-map-gl

[Bug] Uncaught ReferenceError: _define_property is not defined

Open
#2,569 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
8.5k
Forks
1.4k
Avg merge
5d 17h
Merged PRs (30d)
3

Description

Description

Bit of an odd one that I can't quite figure out. react-map-gl has a peer dependency on maplibre-gl. If I end up with a upgrade of maplibre-gl from 5.11.0 to 5.12.0 (or 5.13.0) I get an error in the browser console, and the map doesn't render:

Browser console:

dbf3e5f8-162b-4b7e-8…-d8d408c9388f:17308 Uncaught ReferenceError: _define_property is not defined
    at dbf3e5f8-162b-4b7e-8…8d408c9388f:17308:9
    at dbf3e5f8-162b-4b7e-8…8d408c9388f:19735:7
Not working with maplibre-gl 5.12.0
Image
mat@devbox:~/dev/sandbox$ pnpm add maplibre-gl@5.12.0
Already up to date
Progress: resolved 299, reused 228, downloaded 0, added 0, done
Done in 1.9s using pnpm v10.23.0

mat@devbox:~/dev/sandbox$ pnpm why maplibre-gl
Legend: production dependency, optional only, dev only

airfieldmap@0.1.0 /home/mat/dev/sandbox (PRIVATE)

dependencies:
maplibre-gl 5.12.0
react-map-gl 8.1.0
├─┬ @vis.gl/react-maplibre 8.1.0
│ └── maplibre-gl 5.12.0 peer
└── maplibre-gl 5.12.0 peer
Working okay with maplibre-gl 5.11.0
mat@devbox:~/dev/sandbox$ pnpm add maplibre-gl@5.11.0
Packages: +3 -4
+++----
Progress: resolved 298, reused 227, downloaded 0, added 0, done

dependencies:
- maplibre-gl 5.12.0
+ maplibre-gl 5.11.0 (5.13.0 is available)

Done in 3s using pnpm v10.23.0

mat@devbox:~/dev/sandbox$ pnpm why maplibre-gl
Legend: production dependency, optional only, dev only

airfieldmap@0.1.0 /home/mat/dev/sandbox (PRIVATE)

dependencies:
react-map-gl 8.1.0
├─┬ @vis.gl/react-maplibre 8.1.0
│ └── maplibre-gl 5.11.0 peer
└── maplibre-gl 5.11.0 peer
Image

I guess it's a maplibre-gl problem, but I'm using it from react-map-gl and getting confused. Am I doing anything stupid in the attached sandbox?

Expected Behaviour

Works the same between maplibre-gl@5.11.0 and maplibre-gl@5.12.0 (or 5.13.0)

Steps to Reproduce

sandbox.zip

Environment

Framework version: react-map-gl@8.1.0
Map library: maplibre-gl@5.12.0
Browser: Chrome 142.0.7444.176
OS: Windows 11 25H2 26200.7171

Logs

No response

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

Start with the attached sandbox.zip and reproduce the browser ReferenceError while switching between maplibre-gl 5.11.0 and 5.12.0 or 5.13.0. Compare the package behavior and browser output; done means the map renders without the _define_property error on the newer versions, or the incompatibility is clearly isolated.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.