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.

Uncaught TypeError: Cannot read property 'load' of undefined

See original GitHub issue

Experienced 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:open
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mcmxcdevcommented, Jan 17, 2022

Did anyone figure out how to make Google auth work inside a Chrome extension with manifest v3?

2reactions
anthonyjgrovecommented, Apr 23, 2020

done, v5.1.10

Read more comments on GitHub >

github_iconTop 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 >

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