"internal" is what the client sees when the function throws something that isn't an HttpsError. The real error is in the function logs: Firebase console → Functions → Logs, or firebase functions:log --only createInvite.
Once you find it, throw errors you want the client to see like this:
import { HttpsError } from "firebase-functions/v2/https";
throw new HttpsError("invalid-argument", "Email is missing");Also make sure the region matches. If the function is deployed to europe-west1 and the client uses getFunctions(app) without a region, it calls us-central1 and you can get confusing errors. Use getFunctions(app, "europe-west1").