Error on login when used in production environment
See original GitHub issueHello, 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:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@TomPradat Thank you. My error is
Uncaught TypeError: b is not a function at google-login.js:1
You solution works like a charm!