argument #0:
'Appwrite service :: createAccount() :: '
error:
AppwriteException {
name: 'AppwriteException',
code: 500,
type: 'general_unknown',
response: {
message: 'Server Error',
code: 500,
type: 'general_unknown',
version: '0.11.59'
},
fileName: 'http://localhost:5173/node_modules/.vite/deps/appwrite.js,
lineNumber: 550,
columnNumber: 5,
message: 'Server Error'
}
//Code
async createAccount({email, password, name}){
try {
const avatars = new Avatars(this.client);
const avatarUrl = avatars.getInitials(name);
const userAccount = await this.account.create(ID.unique(), email, password, name)
if(!userAccount){
throw Error
}
const userId = userAccount.$id
const newUser =await this.databases.createDocument(
conf.appwriteDatabaseId,
conf.appwriteUsersCollectionId,
ID.unique(),
{
UserId : userId,
Username : name,
Password : password,
Email : email,
ImageUrl : avatarUrl
})
if(!newUser){
throw Error
}else{
console.log('login')
return this.login({email, password})
}
} catch (error) {
console.log("Appwrite service :: createAccount() :: ", error)
}
}