gapi is not defined – Google sign in issue with gapi.auth2.init
It happens because you have async and defer attributes on your script tag. gapi would be loaded after your script tag with gapi.auth2.init… To wait for gapi before executing this code you can use onload query param in script tag, like following: Or for case when you need it in many places, you can use … Read more