Search code examples
javascriptpolymerweb-componentpolymer-1.0

Polymer google-signin element gets Cannot read property 'currentUser' of null


I'm trying to get the google-signin element to work with just adding this to my HTML:

<google-signin clientId="[my-client-id]" scopes="https://www.googleapis.com/auth/drive"></google-signin>

The Sign-in button shows up on the page, but when I click it, I get the error:

Cannot read property 'currentUser' of null

I'm testing it out on just localhost, so I'm not sure if this is a client id domain issue, or if there's more I need to do in JS to handle the return object?

Any thoughts? Thanks a lot!


Solution

  • Try client-id instead of clientId.

    <google-signin client-id="[my-client-id]" scopes="https://www.googleapis.com/auth/drive"></google-signin>
    

    The google-signin documentation for this attribute doesn't match with the actual code.