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.

TypeError: provider.addScope is not a function in `createAuthProvider`

See original GitHub issue

I am trying to trigger a login action with the following code:

export function onTwitterLogin () {
  return (dispatch, getState, getFirebase) => {
    getFirebase().login({
      provider: 'twitter'
    })
  }
}

And I get the following error:

Uncaught (in promise) TypeError: provider.addScope is not a function
    at createAuthProvider ...

This is the stack trace:

createAuthProvider	@	auth.js:37
getLoginMethodAndParams	@	auth.js:77
login	@	auth.js:225
login	@	compose.js:147
(anonymous function)	@	auth.js:7

Looks like the addScope function doesn’t exist for the TwitterAuthProvider

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
prescottpruecommented, Dec 21, 2016

Fixed within v1.1.3 release. I also added a unit test to cover Twitter login as well as any other providers that don’t have addScope.

0reactions
eloypndcommented, Dec 22, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: this.addScope is not a function while trying to ...
As it shows in the example of GoogleAuthProvider , you need to initialize auth provider with a new instance. And I think you...
Read more >
GoogleAuthProvider | Firebase JavaScript API reference
addScope('profile'); provider.addScope('email'); firebase.auth().signInWithPopup(provider).then(function(result) { // This gives you a Google Access Token.
Read more >
TypeError: firebase.auth is not a function - YouTube
In this video, we're going to be discussing the TypeError : firebase.auth is not a function error. This error is often encountered when ......
Read more >
Signing in users with Google | Identity Platform ...
Go to the Identity Providers page in the Google Cloud console. · Click Add A Provider. · Select Google from the list. ·...
Read more >
Authentication
import { OAuthProvider } from "firebase/auth"; const provider = new ... addScope('user_birthday'); // Assuming the current user is an Apple user linking 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