Back

I need help with AppwriteException: Invalid

  • 0
  • Cloud
propconnect
25 Nov, 2024, 06:02

ProjectId: 6742a91e002b33b3d5a1 Databases: 6742ecf80002e1489935 Users collection: 6743651f001e2f7e8338

I'm playing around with an old JSM app tutorial and its outdated since Appwrites recent updates. (https://www.youtube.com/watch?v=_W3R2VwRyF4)

Im getting this error when trying to create a new account "AppwriteException: Invalid userId param: Parameter must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char at _Client.<anonymous> (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=9a556461:466:15) at Generator.next (<anonymous>) at fulfilled (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=9a556461:13:24)"

the account/user is getting created correctly in Appwrite cloud console, but i just cant seem to get logged and sent to the '/' as it should

I have a feeling that it might have something to do with this line 'const session = await account.createSession(user.email, user.password);' as it used to be createEmailSession....

My api.ts file is attached

Any help would be much appreciated! Please let me know if you need any more information. Thanks!

TL;DR
Developers are encountering an 'AppwriteException: Invalid' error when creating a new account due to recent updates. The issue lies in the userId parameter length restriction. The account creation works fine in the console but login redirection doesn't. The problem may be related to the line 'const session = await account.createSession(user.email, user.password);' in the code. Check and update the code accordingly.
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