Skip to content

Error: The Google Maps JavaScript API could not load. #823

Closed
@tarochipz

Description

@tarochipz

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.

  1. Is it possible to add more information in this error so we can tell what the actual issue is ?
  2. 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:

Screenshot 2024-02-13 at 11 20 13 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions