Closed
Description
I am seeing a bunch of Error: The Google Maps JavaScript API could not load.
errors in our Sentry. But there is no additional information on the error.
- Is it possible to add more information in this error so we can tell what the actual issue is ?
- Can you help confirm the following:
- This post says
”The API session token expires if someone leaves a map open for more than about 24 hours, so it's normal to see a low level of these errors. (This is the intended behavior)”
. The majority of this error (not all though) comes from our app/logout
URL -- would a session expiry lead to this error ? Our app session timeout redirects users to the/logout
url but it's max 20 minutes. - What else could potentially cause this error (aside from things like network issues) ?
This is how we're using the loader in our app wrapper:
import { Loader } from '@googlemaps/js-api-loader'
...
...
const googleMapsLoader = new Loader({
apiKey: (window as any).GoogleMapsKey,
version: 'weekly',
libraries: ['places'],
})
googleMapsLoader.importLibrary('places').catch((error: Error) => {
console.error(error)
diagnostics.captureException(error)
})
...
This is the Sentry error: