react-google-maps: [Bug] Cannot remove a WebglOverlay that has not been set to a map

Description

Got the warning "Cannot remove a WebglOverlay that has not been set to a map " when using AdvancedMarker

Steps to Reproduce

Render the markers on the map by AdvancedMarker, got the warning (please see the below) from Chrome when leaving the page of the MAP

“Cannot remove a WebglOverlay that has not been set to a map”

Environment

  • Library version: 1.0.2
  • Google maps version: weekly
  • Browser and Version: Chrome
  • OS: MAC OS

Logs

Cannot remove a WebglOverlay that has not been set to a map
overrideMethod @ console.js:273
a @ js?key=XXXXXX&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__:376
_.sn.map_changed @ js?key=XXXXXX&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__:376
Uk @ js?key=XXXXXX&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__:161
_.Sk.set @ js?key=XXXXXX&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__:284
(anonymous) @ js?key=XXXXXX&solution_channel=GMP_visgl_rgmlibrary_v1_default&loading=async&callback=__googleMapsCallback__:169
dispose @ marker.js:103
aPa @ marker.js:60
dispose @ marker.js:129
setMap @ marker.js:122
set map @ marker.js:121
(anonymous) @ index-C8vDtd08.js:417
Xm @ index-C8vDtd08.js:40
Fs @ index-C8vDtd08.js:40
Xo @ index-C8vDtd08.js:40
YR @ index-C8vDtd08.js:40
bi @ index-C8vDtd08.js:40
q1 @ index-C8vDtd08.js:40
ci @ index-C8vDtd08.js:38
(anonymous) @ index-C8vDtd08.js:40

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 24 (2 by maintainers)

Most upvoted comments

Turns out, the error-message can be easily reproduced with the vanilla API. I created an Issue in the maps issue tracker about this: https://issuetracker.google.com/issues/356878392 (please +1 the issue there to raise awareness)

Also, while you’re here, could you please have a quick look at this codesandbox and confirm that the warning-message is logged for you as well: https://codesandbox.io/p/sandbox/repro-adv-marker-remove-warning-nccv7y?file=%2Fsrc%2Findex.ts%3A29%2C66

(if you don’t see the message in the console, please add a comment here with your browser / os / related error-messages)

The thing is, this has no immediate relation to anything we are doing with the maps API. That WebglOverlay mentioned in the error-message isn’t something we create or interact with.

It could be something used internally by the AdvancedMarker implementation, maybe related to the collision-handling or something like that. I am in contact with folks at the google maps team about this.

What would help the most in that context, would be a vanilla JS example that triggers this error, but I haven’t yet had the time to investigate this further. It might be as simple as running marker.map = null on a marker that hasn’t first been added to the map (at least that is something I could see out library doing).

The thing is, we’re only using the google.maps.marker.AdvancedMarkerElement, and there’s nothing in this library that has anything to do with the google.maps.WebGLOverlayView. The error ocurs internally in the maps API (notably, it occurs in the marker.js file, not in webgl.js), and there’s no explanation I’ve found so far what this WebglOverlay from the error-message is (I’m pretty sure that it’s an error message that wasn’t intended to be seen by Maps API users at all).

I’m looking to reproduce this error-message without our library, which should tell us how this could be fixed in the library.

As far as I am aware, this also doesn’t affect applications built with this library (besides an annoying error-message in the console), am I wrong on that?

@usefulthink Hi, just for your information: there is a feature to delete a specific revision of the edit history in GitHub. Probably, you have the edit permission for this.

Awesome, haven’t seen that option before. Thanks and done.