You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exports.sendWelcomeEmail = functions.auth.user().onCreate((user) => {
console.log(sendWelcomeEmail New user created: UID - ${user.uid});
// Add your email sending logic here
return null; // Always return a value from a Cloud Function
});
"
},
[REQUIRED] Expected behavior
Expect the function to deploy without issue.
[REQUIRED] Actual behavior
TypeError: Cannot read properties of undefined (reading 'user')
Error: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
Were you able to successfully deploy your functions?
No, const functions = require('firebase-functions') in version 6.0.1 of firebase functions makes functions.auth.user() undefined
The text was updated successfully, but these errors were encountered:
Related issues
[REQUIRED] Version info
node:
v20.17.0
firebase-functions:
6.0.1
firebase-tools:
13.18.0
firebase-admin:
12.5.0
npm
10.8.2
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Upgrade firebase-admin to v12.5.0 and firebase-functions to v6.0.1
Try to deploy this basic code in parenthesis
"
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.helloWorld = functions.https.onRequest((req, res) => {
res.send('Hello from Firebase Functions!');
});
exports.sendWelcomeEmail = functions.auth.user().onCreate((user) => {
console.log(
sendWelcomeEmail New user created: UID - ${user.uid}
);// Add your email sending logic here
return null; // Always return a value from a Cloud Function
});
"
},
[REQUIRED] Expected behavior
Expect the function to deploy without issue.
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
No, const functions = require('firebase-functions') in version 6.0.1 of firebase functions makes functions.auth.user() undefined
The text was updated successfully, but these errors were encountered: