Skip to content

Uncaught TypeError: e.auth.addAuthTokenListener is not a function #5018

Closed
@tomhicks

Description

@tomhicks

[REQUIRED] Describe your environment

  • Operating System version: mac OS 10.15.7
  • Browser version: Chrome 91
  • Firebase SDK version: 8.6.7
  • Firebase Product: firestore/auth

[REQUIRED] Describe the problem

Crash on startup with error Uncaught TypeError: e.auth.addAuthTokenListener is not a function

Steps to reproduce:

Upgraded a project to 8.6.7 from 8.6.3, and getting the following error as firestore is initialised:

index.js:383 Uncaught TypeError: e.auth.addAuthTokenListener is not a function
    at n (prebuilt-d16b955d-cdb9e87f.js:14583)
    at eval (prebuilt-d16b955d-cdb9e87f.js:14586)
    at Provider.onInit (index.esm.js:302)

By stopping the debugger, I can see the minimised code something like this:

(t) => {
  e.auth = t;
  e.auth.addAuthTokenListener(...);
}

The problem is that the t parameter is true whereas I presume it's supposed to be an auth instance.

Note:

Something interesting when I was investigating...I put my firebase version back to 8.6.3 and ran npm install again, but the problem remained. My assumption is that there's some dependency that wouldn't have gone back down by going from 8.6.7 to 8.6.3 that has the problem.

That was all nonsense. I was editing a different project's package.json!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions