question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gapi client not loading

See original GitHub issue

Hi,

This package has worked swimmingly for me in the past, but has recently stopped working as it does not load gapi in the window, such that the following:

index.js(31)

      window.gapi.load('auth2', () => {

returns this error:

Uncaught TypeError: Cannot read property 'load' of undefined
    at HTMLScriptElement.<anonymous> (google-login.js:1)

I’ve also tried using the module in a test boilerplate project and it still has this issue. The script is inserting itself before the first script element in document.scripts but it’s not loading. Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
iantbutler01commented, Apr 2, 2017

I was able to circumvent it by including gapi in my html

<script src="https://apis.google.com/js/platform.js?onload=onLoadCallback" async defer></script>

But it seems like you may have some async issue down there with react componentDidMount (where it looks like its breaking) firing before gapi has been loaded.

1reaction
deconstructionalismcommented, Mar 29, 2017

It was the Disconnect Chrome extension. All good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gapi.client.load not working - Stack Overflow
After spending hours googling the problem, I found out the problem was because I was running this file on the local machine and...
Read more >
unable to load library gapi.load('client:auth2',function) #406
i first loaded the script then tried to init the client but it was failing environment : npm and webpack attached the snapshot...
Read more >
gapi.auth.authorize not working? - Google Groups
My problem is that auth.init isn't working. As a result, checkAuth is never getting called. I'm also getting another error that I can't...
Read more >
Google Sign-In JavaScript client reference | Authentication
This reference describes the JavaScript client methods and attributes you will use to implement Google Sign-In in your web applications. If you ...
Read more >
GAPI — The Google APIs Client Library for Browser JavaScript
One of the easiest ways to use an API is by not having a server at all. ... Loading the gapi client; Initializing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found