Back

Invalid email: Value must be a valid email address

  • 0
  • Accounts
  • Web
Ayush_Parui
28 Aug, 2023, 04:18

Earlier I didn't find this error while sending a request. Can you help me with this error

import { Client, Account, ID } from "appwrite"; import config from "../conf/config"; const client = new Client(); const account = new Account(client); client.setEndpoint(config.appwriteURL).setProject(config.appwriteProjectID); export class authService{ async signup(name, email, password){ try { await account.create(ID.unique(), name, email, password); return true } catch (error) { console.log(error) return false } } } const authServices = new authService(); export default authServices;

TL;DR
The user encountered an "Invalid email: Value must be a valid email address" error while trying to sign up using the appwrite library. They suspect that the order of the parameters in the account.create() call is incorrect and that the name should go last. The user also suggests using triple backticks for multi-line code. They need help with resolving the error. Solution: It is unclear if the order of the parameters is causing the error. To resolve the "Invalid email" error, make sure to pass a valid email address as the email parameter when calling the account.create() method.
Drake
30 Aug, 2023, 01:48

I dont think the order of parameters for the account.create() call is correct. Name should go last.

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more