Firebase errors are exported as stubs
@jonathanedey is already working on this.
Since Oct 7, 2025.
Assessment
This issue has not been assessed yet.
Description
[READ] Step 1: Are you in the right place?
- For issues related to the code in this repository file a Github issue.
- If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
template. - For general technical questions, post a question on StackOverflow
with the firebase tag. - For general Firebase discussion, use the firebase-talk
google group. - For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: _____
- Firebase SDK version: 12.1.1
- Firebase Product: auth
- Node.js version: _____
- NPM version: _____
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
The new error types that are exported in 12.1.1 are great and make error handling much easier. However, the TS interfaces are notably lacking constructors - they just extend all the way to Error. The actual implementations take info: ErrorInfo, message?: string parameters to set the underlying code and message properties.
This means that in testing code I'm not able to really take advantage of the new types without casting or playing other type shenanigans in order to set the properties as expected, which significantly limits the usefulness of these newly exported types.
Relevant Code:
// In a node REPL
> let err = new FirebaseAuthError("test error message")
undefined
> err.code
'auth/undefined'
> err.message
undefined
> let err2 = new FirebaseAuthError({ message: "test error 2", code: "val" })
undefined
> err2.code
'auth/val'
> err2.message
'test error 2'
// In typescript
// Argument of type '{ message: string; code: string; }' is not assignable to parameter of type 'string'.
const error = new FirebaseAuthError({ message: "test error 2", code: "val" });
Relates to https://github.com/firebase/firebase-admin-node/pull/2549
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-admin-node
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comments · 1 assignee ·
-
api: messaging
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficulty 5/5 Over a week Newbie friendliness 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comment · 1 assignee ·
All issues in firebase/firebase-admin-node
Similar issues
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
joinmarket-webui/jam#1496 · 1 comment ·
-
Tech
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
opencrvs/opencrvs-core#13865 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
linagora/twake-calendar-frontend#1377 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
EclipseFdn/open-vsx.org#13385 · 1 comment ·