Uncaught TypeError: Cannot read property 'load' of undefined
See original GitHub issueExperienced when using the hook like so:
/* useGoogleLogin.js */
import { useGoogleLogin } from 'react-google-login'
import config from 'config'
import { useActions, GoogleActions } from 'modules'
const SCOPES = [
'email',
'profile',
'openid',
//... a few more scopes
]
export default () => {
const actions = useActions({
googleLoginSuccess: GoogleActions.googleLoginSuccess,
googleLoginPending: GoogleActions.googleLoginPending,
googleLoginFailed: GoogleActions.googleLoginFailed,
})
return useGoogleLogin({
clientId: config.GOOGLE_CLIENTID,
cookiePolicy: 'single_host_origin',
scope: SCOPES.join(' '),
onSuccess: actions.googleLoginSuccess,
onFailure: actions.googleLoginFailed,
onRequest: actions.googleLoginPending,
})
}
/* SomeComponent.js */
import useGoogleLogin from './useGoogleLogin.js'
const SomeComponent () => {
const { signIn, loaded } = useGoogleLogin()
if (!loaded) return null
else return <button onClick={signIn}>Sign in</button>
}
The component version is being used elsewhere in the application without issue. Let me know what other information you need to debug.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
"Cannot read property 'load' of undefined" - Stack Overflow
Try adding an onload event to the script tag. So change your script tag to
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >Uncaught TypeError: Cannot read property 'load' of undefined
i have a proble with .load() data into datatable. here my code. webix.ready(function() { $$(“tabel_barang”).load(“crud/load-data.php”);
Read more >Uncaught TypeError: Cannot read property 'load' of undefined
This looks to be an incompatibility between a library we are using for scheduling (moment-js) our dependency loading system (lasso) and a ...
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
Did anyone figure out how to make Google auth work inside a Chrome extension with manifest v3?
done, v5.1.10