Cannot find module 'firebase-functions/v2/auth' or its corresponding type declarations.
This is error I get on import { onDelete } from "firebase-functions/v2/auth";
What I tryied from other tickets I have found:
delete node_modules
, delete package-lock.json
, run install.
add "exclude": ["node_modules", "functions"]
to my tsconfig.json
in root.
In fact, to date, there has never been a "firebase-functions/v2/auth" import to use.
The "v2" you see in other Firebase product imports indicates use of second generation functions. The "v1" means first generation. Authentication functions aren't yet available for 2nd gen functions, according to the documentation:
Note: Cloud Functions for Firebase (2nd gen) does not provide support for the events and triggers described in this guide. Because 1st gen and 2nd gen functions can coexist side-by-side in the same source file, you can still develop and deploy this functionality together with 2nd gen functions.
For now, you must keep using the v1 version imports for Authentication triggers, and none of the instructions for migrations to v2 apply.