mapbox-gl-js
mapbox-gl-js copied to clipboard
Switching away from the map while it is loading causes a `t.getActor() is undefined` error that cannot be caught before it has been logged to the console
mapbox-gl-js version: 1.6.1
browser: Firefox 120.0 (64-bit)
Steps to Trigger Behavior
- Have two pages, one where the map is loaded
- Switch to the other page when the map object has been created but before it starts rendering any tiles
- You will then see various "Uncaught TypeError: t.getActor() is undefined" console errors
Expected Behavior
Have a way to stop this from happening.
Actual Behavior
I cannot stop this error from being output to the terminal.
- I've tried wrapping the
new mapboxgl.Mapcall in a try catch but that does not get triggered likely because the problematiccacheEntryPossiblyAdded mapbox-gl.js:29call is actually a callback. - Same with defining a
map.on('error'right after the map creation, the error doesn't seem to go through that flow for some reason.
Hi @Stephane-Ag,
Thank you for opening this ticket. Please provide a minimal, complete, verifiable demonstration of the issue to help the maintainers and community understand and address the problem accurately. We recommend using https://jsbin.com/. Please include information about the browser version and operating system used.