Skip to content
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

gapi.load resulting in 404 #447

Closed
Domiii opened this issue Jul 2, 2018 · 2 comments
Closed

gapi.load resulting in 404 #447

Domiii opened this issue Jul 2, 2018 · 2 comments

Comments

@Domiii
Copy link

Domiii commented Jul 2, 2018

I have been using the gapi JS client successfully for a while now.
However, today, I suddenly get a 404 without any error reporting when using gapi.load.

This is my code:

return gapi.load('client:auth2', {
  callback: function () {
    // Handle gapi.client initialization.
    resolve(_gapiInit());
  },
  onerror: function (err) {
    reject(new Error('gapi.client failed to load - ' + (err.stack || JSON.stringify(err))));
  },
  timeout: 5000, // 5 seconds.
  ontimeout: function () {
    // Handle timeout.
    reject(new Error('gapi.client timeout'));
  }

This is what my console tells me:

gapi.js:218 GET https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.ud0X1ANlltY.O/m=auth2,client/rt=j/sv=1/d=1/ed=1/am=AQE/rs=AGLTcCOcKpCWy1ppnaz1rAfxsno0yxWUNA/cb=gapi.loaded_0 404 ()
debugUtil.js:27 gapi init failed - Error: gapi.client timeout

Note: I get the 404 right away. It does not even get reported as an error; instead the timeout hits five seconds later.

@Domiii
Copy link
Author

Domiii commented Jul 5, 2018

I found the issue: I had a downloaded/cached version of api.js and it got outdated without a warning. Getting the latest version fixes it.

Is there any plans to support versioning for this library?
Maybe an NPM module even?

@grant
Copy link
Contributor

grant commented Aug 29, 2018

Hi @Domiii, please upvote #432 for the npm support issue where that issue can be discussed.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants