question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on login when used in production environment

See original GitHub issue

Hello, first thanks for this very handy library!

Everything is working fine on dev environment but when I build to production using webpack I am having a few issues with the gapi script.

The build works fine but this is throw in the console then I first load the page

cb=gapi.loaded_0:75 Uncaught TypeError: a is not a function
    at google-login.js:1
    at h.o0 (cb=gapi.loaded_0:83)
    at xs (cb=gapi.loaded_0:86)
    at Wq (cb=gapi.loaded_0:86)
    at _.C.uea (cb=gapi.loaded_0:85)
    at Ap (cb=gapi.loaded_0:79)
    at <anonymous>

The thing is, this is not happening all the time. Sometimes it works and sometimes not. I think its possible that the function that checks if the script is loaded is not very accurate.

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
TomPradatcommented, Apr 3, 2018

It looks like the error comes from when the gapi auth fails, the onFailure props is called but there is no default prop so the function is undefined.

@ayualdilasalma Try to provide a onFailure function to your GoogleLogin component.

After checking the doc, the onSuccess and onFailure are indeed REQUIRED props.

0reactions
lane-ebcommented, Jun 11, 2020

@TomPradat Thank you. My error is Uncaught TypeError: b is not a function at google-login.js:1 You solution works like a charm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Security problem Users could not Login to Production ...
Security problem Users could not Login to Production Environment ... I created an application with security on group level, everything is good.
Read more >
Error while login to production workbench using my credentials
This error message indicates that the org admin has either blocked the usage of workbench or has given access for workbench only for...
Read more >
Login error while running my application on cloud, on local it ...
The login/user account you have locally doesn't have to exist on your Test/Acceptance/Production environment. So make sure you create the user ...
Read more >
Issue/error only in production, not in local dev. Trying to ...
When I register/login through in the local environment, everything works fine. I believe it's because the site is live, yet it's still going ......
Read more >
Logging For Production. Dev, think about Ops! | THG Tech Blog
The problem is this code is catching any error and, to make matters worse, throws away all information about it. When catching an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found