gpointnerbbooe opened a new issue, #45373:
URL: https://github.com/apache/superset/issues/45373
### Bug description
### Summary
In 7.0.0rc1 (and current `7.0` / `master`), every deck.gl chart using the
**MapLibre** renderer with a **vector** basemap style shows an empty white
background — including the built-in defaults "Light (Carto)", "Dark (Carto)",
"Streets (Carto)" and "Liberty (OpenFreeMap)". The data layers render fine on
top; only the basemap is missing. Raster styles (`Streets (OSM)`, `tile://…`
entries in `DECKGL_BASE_MAP`) work.
### Steps to reproduce
1. Run the `apache/superset:7.0.0rc1` image with default config.
2. Create any deck.gl chart (e.g. deck.gl Polygon), Map Renderer = MapLibre,
Map Style = "Light (Carto)".
3. Observe: the attribution "© CARTO, © OpenStreetMap" is shown,
`style.json`, `tiles.json` and the sprites are fetched — but **no vector tile
(`.pbf`) is ever requested**, the basemap stays white. No error in the console.
### Root cause
Same bug that #44042 fixed for `plugin-chart-point-cluster-map`, but
`preset-chart-deckgl` never got the fix:
- #44030 (Dependabot security group) bumped `preset-chart-deckgl`'s
`maplibre-gl` from `^5.24.0` to `^6.8.0`. maplibre-gl 5 inlined its worker;
maplibre-gl 6 loads it from a URL derived from `import.meta.url`.
- webpack rewrites `import.meta.url` to the build-time path, so in the
shipped bundle the worker URL resolves to `""`:
```js
let e =
"file:///app/superset-frontend/node_modules/maplibre-gl/dist/maplibre-gl.mjs";
if (!/^https?:/.test(e)) return "";
```
The worker is then constructed with an empty URL (= the current page),
loads the HTML page as a script, and dies immediately — so no tiles are ever
fetched.
- #44042 already copies `maplibre-gl-worker.mjs` / `maplibre-gl-shared.mjs`
into the static output (both are served fine from `/static/assets/`), but
`maplibregl.setWorkerUrl(...)` is only called in
`plugin-chart-point-cluster-map/src/MapLibre.tsx`. Nothing in
`preset-chart-deckgl` calls it. #44042's description itself notes the deck.gl
half as "still unresolved … tracked separately", but I couldn't find a tracking
issue.
Likely consequence (from reading the code, not tested): deck.gl vector
basemaps would only work by accident if a Point Cluster Map chart had been
rendered earlier in the same page session, since that sets the URL on the
shared `maplibre-gl` module.
### Verification
- The exact same style JSON loads fine with plain `maplibre-gl@6` outside
Superset (tiles, glyphs and sprites all requested, no errors).
- In Superset 7.0.0rc1, a Playwright session shows a worker being started
with the page URL, which terminates instantly; zero `.pbf` requests for Carto
as well as for a custom vector style.
### Suggested fix
Call the same thing #44042 added, before the first MapLibre map mounts in
the deck.gl plugin (e.g. at module level of
`preset-chart-deckgl/src/DeckGLContainer.tsx`, or in a small shared helper used
by both plugins):
```ts
import maplibregl from 'maplibre-gl';
maplibregl.setWorkerUrl(`${__webpack_public_path__}maplibre-gl-worker.mjs`);
```
A regression test with a real browser (like the one described in #44042)
would catch this, since jest mocks `maplibre-gl`.
### Workaround
Use raster styles only, e.g. in `superset_config.py`:
```python
DECKGL_BASE_MAP = [["https://tile.openstreetmap.org/{z}/{x}/{y}.png",
"Streets (OSM)"], ...]
```
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
I don't know
### Node version
I don't know
### Browser
Chrome
### Additional context
- Image: `apache/superset:7.0.0rc1` (Docker), MapLibre renderer, no Mapbox
key, default `TALISMAN_CONFIG` (only extended `connect-src`/`img-src` for an
extra raster tile host).
- Reproduced in two different browsers (Chromium-based and another one);
also verified that `7.0` and `master` contain the same code path (no
`setWorkerUrl` in `preset-chart-deckgl`).
- Related: #44030 (maplibre-gl 5 → 6 bump), #44042 (fix for
point-cluster-map only), #42608 (original investigation).
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [x] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]