Hi there,
I have what looks like a strange issue: I am getting a Warning about a possible unhandled promise rejection, that says "Error: AppwriteException: Missing required parameter: "email"" and it's pointing to my "throw" statement in a try/catch block:
TypeScript
try {
const newAccount = await account.create(
ID.unique(),
email,
password,
username
);
if(!newAccount) throw Error;
const avatarUrl = avatars.getInitials(username);
await signIn(email, password);
const newUser = await databases.createDocument(
appwriteConfig.databaseId,
appwriteConfig.userCollectionId,
ID.unique(),
{
accountId: newAccount.$id,
email,
username,
avatar: avatarUrl,
}
);
return newUser;
} catch (error) {
throw new Error(error);
}
}```
Any ideas?
TL;DR
Possible unhandled promise rejection error due to missing "email" parameter. Check that the "email" parameter is being passed correctly. Fix by ensuring the "email" parameter is included when calling the function in the createUser function.Recommended threads
- Database column name change makes table ...
Hi, new here! I'm currently building an app where there's a table called "track_sessions" whose column "creator" I wanted to change to "creatorID". However, af...
- SyntaxError: The requested module 'node-...
I am trying to use appwrite functions and in the function i am creating rows but i got this error when i executed the funtion. As i checked docs there TablesDB...
- Using OTP Email to verify user for passw...
Has anyone ever implemented this? If you did what was your aproach? Did you write an appwrite function?