mapbox-gl production build error "x is not defined"
Open
Nobody has claimed this yet.
FAQ
- Dominant language
- TypeScript
- Stars
- 8.5k
- Forks
- 1.4k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 3
Description
I upgraded to 6.0.0 (also tried 6.0.1) and everything works fine in development mode, but in the production build the background map doesn't render using. I'm using a mapbox token.
<StaticMap
key="map"
width="100%"
height="100%"
mapStyle={MAPBOX_MAP_STYLE}
mapboxApiAccessToken={MAPBOX_ACCESS_TOKEN}
/>
I have an IconLayer that renders just fine, but on top of a grey background :/
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
Reproduce the production-only failure with react-map-gl 6.0.0 or 6.0.1 using the shown StaticMap, map style, and Mapbox token, then compare it with development mode. Start by tracing the StaticMap and IconLayer rendering paths; done means the background map renders in the production build instead of remaining grey.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100