Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Function - Cannot find module 'firebase-functions/v2/auth'

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.

like image 903
Dima Malko Avatar asked Jul 30 '26 01:07

Dima Malko


1 Answers

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.

like image 64
Doug Stevenson Avatar answered Jul 31 '26 14:07

Doug Stevenson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!