Question

I have code - unchanged from yesterday - that just stopped working. Odd, I know. But I've looked at it over and over. And nothing in my code has changed.

I am using the Javascript API Client library to load the 'plus' API. As of last night (7/25/2013), this code was working fine. Now, I get the gapi.client and call gapi.client.load and the callback is never getting called.

In my index.html, I have the following:

<script type="text/javascript" src="https://apis.google.com/js/client.js?onload=onLoadCallback"></script>

My onLoadCallback() function looks like this:

function onLoadCallback() {
    try{
        console.log( "gapi.client: " + gapi.client  );
        gapi.client.load('plus', 'v1', function() {
                     console.log('plus loaded!');
                     });
    }
    catch(err) {
        console.log( "onLoadCallback error: " + err.message );
    }
}

This callback never gets called (and I've checked for syntax errors so if there are any above it was during my copy/paste into StackOverflow).

When I load this code in Chrome and look at the console: I see the following:

gapi.client: [object Object] 

followed by:

Uncaught SyntaxError: An invalid or illegal string was specified. 
rs=AItRSTMqSYNvDyDFNs8wjPrZc5pR-M_27Q:83

And, when clicking on that reference to rs=....:83, it seems to be in the middle of some code that isn't my code. Looks like something to do with the Google API Javascript library.

I should also note that, if I comment out the gapi.client.load line, then this error doesn't appear on the Javascript console. So, it definitely seems to be a result of the call to gapi.client.load.

Has anyone else experienced any unusual behavior or changes to the GAPI Javascript client library that would cause this error?

Thanks for any help or insight.

[NOTE: Tagged as Google-App-Engine because this also happens to be in an app accessing an App Engine and asking for the user's ID to access it. And there isn't a StackOverflow tag for Google-API-Client-Library yet.]

[Edit: I should note that the original app is in PhoneGap. The comments on looking in the Javascript console below are from when I was trying to debug the app in a browser since the console logging from the PhoneGap app was less than satisfactory.]

Was it helpful?

Solution

Those of us PhoneGap developers who were affected by this are waiting for confirmation that this was confirmed and fixed at the Google API Javascript Client level. However, overnight, the gapi.client.load started working again.

The issue was entered and tracked at: https://code.google.com/p/google-api-javascript-client/issues/detail?id=95

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top