This Firebase blog post says that Gen 2 functions are available from 7/31/23, but when I try to firebase deploy
one of them, I get this error:
Error: [callGroupRTDBSetup(us-central1)] Upgrading from GCFv1 to GCFv2 is not yet supported. Please delete your old function or wait for this feature to be ready.
A few days ago I recreated my project from scratch, doing firebase init
all over again. I think the only thing I might not have updated is Node.js. Today I ran npm update -g firebase-tools
because it told me there was an update available. I also restarted my computer. My firebase --version
is now 12.4.7.
import {onCall} from "firebase-functions/v2/https";
exports.callGroupRTDBSetup = onCall({cors: true}, async (req) => {
try {
const groupID = req.data.groupID;
const adminUID = req.data.adminUID;
const adminUsername = req.data.adminUsername;
const createdTimestamp = req.data.createdTimestamp;
await setGroupAdminRTDB(groupID, adminUID, adminUsername, createdTimestamp);
await addMemberRTDB(groupID, adminUID, adminUsername, createdTimestamp);
return {
returnVal: 1,
returnMsg: "callGroupRTDBSetup success!",
};
} catch (error) {
throw new HttpsError("invalid-argument", "Error: " + error);
}
});
2
Answers
As explained in the documentation:
If you have a function you don’t mind deleting, just delete it and redeploy.
Here is the documentation for this error message.