Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

GAPI is not always initialised after load #399

Description

@mesqueeb

I have (finally) noticed one of the biggest problems I have. The GAPI client is often not initialised, but hangs just after loading. This is my setup, I'll mark where it hangs:

        window.gapi.load('client:auth2', _ => {
          console.log('loaded GAPI')
          // hangs here
          window.gapi.client.init(gapiConfig)
          .then(_ => {
            console.log('initialised GAPI')
            window.GAPIiniOK = true
            gapi.auth2.getAuthInstance().isSignedIn
              .listen(store.dispatch('gapiAuthListener'))
            // Not required anymore if global auth listener does its job!
            store.dispatch('user/updateAuthStatus')
            .then(_ => {
              resolve()
            })
          }).catch(error => {
            dispatch('authenticationError', {error, note: 'error during gapi initialisation'})
            reject()
          })
        })

It hangs right where I wrote the comment. But the load worked, but the client.init is not launched.
I even added a catch statement, but it doesn't get launched.

Does anyone have any idea why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions