I using firestore for study functions so when i went run that aplication appear this error, if this important, i use npx
“Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error”
Error:
import * as functions from ‘firebase-functions’;
^^^^^^
Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
Code:
import * as functions from ‘firebase-functions’;
import {onDocumentWritten} from “firebase-functions/lib/v2/providers/firestore”;
export function nameUser = onDocumentWritten(“/users/{userId}”, (event) => {
functions.logger.info(ID >> ${event.data?.after.data()}
, {structuredData: true});
})
MagicGanza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.