Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Find or delete non-existing UID results to prevent an uncacheable error.

Open
#2,845 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
firebase, node.js, typescript

Research direction

Start by reproducing the reported behavior with Firebase Auth's admin.auth().getUser(uid) and deleteUser(uid) calls using a nonexistent UID. Review how the supplied TypeScript function handles the auth/user-not-found error and determine the intended behavior for missing users. Done requires a documented or tested result for both lookup and deletion cases.

Written by the indexing model from the issue text.

Description

api: auth

Platform:

  • Operating System version: MacOs - Darwin 23.6.0 arm64 arm
  • Firebase SDK version: 11.11.1
  • Firebase Product: Firebase Auth
  • Bun version: 1.2.2 (Don't think is related)
  • NPM version: 10.8.2

Problem:
Whenever I try to find a user that doesn't exist or delete a uid that doesn't exist it thorws an error that breaks the function and is not cachable for some reaons, and its very weird behavirous that im not able to handle, i tried to use try catch, and then catch, but still the same. This has no steep to reprpoduce the error, its default behaviour.

Code:

import { Firebase } from '@/libs/firebase'
import { Console } from '@/helpers/logs'

const admin = await Firebase()

const DeleteFirebaseAccount = async (uid: string): Promise<boolean> => {
    try {
        const userExists = await admin.auth().getUser(uid)
        if (userExists) await admin.auth().deleteUser(uid)

        return true
    } 
    
    catch (error) {
        Console.Error('DeleteFirebaseAccount', error)
        return false
    }
}

export default DeleteFirebaseAccount

The error:

class FirebaseError extends Error {
29 |     constructor(errorInfo) {
30 |         super(errorInfo.message);
             ^
error: There is no user record corresponding to the provided identifier.
  errorInfo: {
  code: "auth/user-not-found",
  message: "There is no user record corresponding to the provided identifier.",
},
 codePrefix: "auth",
Dominant language
TypeScript
Stars
1.7k
Forks
419
Avg merge
4d 20h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/firebase-admin-node

All issues in firebase/firebase-admin-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.