-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Invalid/Expired API key crashes the page #137
Comments
This seems to be coming from the effect-cleanup for the We should also implement the |
Interesting: react-google-maps/src/components/map/use-map-events.ts Lines 62 to 77 in 69bade0
For the error to happen, |
As discovered in visgl#137, there are apparently situations where the `.addListener()` function that components inherit from the MVCObject class will return undefined in certain edge cases, like when the Map is rendering the fallback-screen for an invalid API-key. Therefore we will use the hopefully more stable `google.maps.event.addListener` method everywhere.
So the main issue should be adressed with #158. Unfortunately the maps API doesn't provide a reasonable way to react to an invalid API key in any other way. The "official" way to handle this would be the |
As discovered in #137, there are apparently situations where the `.addListener()` function that components inherit from the MVCObject class will return undefined in certain edge cases, like when the Map is rendering the fallback-screen for an invalid API-key. Therefore we will use the hopefully more stable `google.maps.event.addListener` method everywhere. Co-authored-by: Malte Modrow <malte.modrow@gmail.com>
Description
If the API key is expired/wrong. Then the page crashes once we move away from the map page. It throws the following error
Cannot read properties of undefined (reading 'remove')
Steps to Reproduce
https://codesandbox.io/p/sandbox/gracious-rain-slhtvx
Now after this If you move again to home page or any other route, It'll crash the page.
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: