I have created google single sign on by following steps mentioned in https://developers.google.com/identity/sign-in/web/sign-in
The sign in works like a charm but when
I had same issue and seems that I found solution for me and I think this should be the case.
you should have method call like that, at the bottom of the script, like me, below:
gapi.load("client", initAuth);
this should be modified like
gapi.load("client:auth2", initAuth);
and this should work (at least worked for me).