I am getting error for creating new document in an collection with new ID.unique() then too getting error of existing document. When button is pressed one document is created and then getting error.
I am using appwrite cloud and next.js with typescript.
Error:
TypeScript
AppwriteException: Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.
callstack:
TypeScript
AppwriteException@http://localhost:3000/_next/static/chunks/node_modules_67e82ec7._.js:492:9
[project]/node_modules/appwrite/dist/esm/sdk.js [app-client] (ecmascript)/call/<@http://localhost:3000/_next/static/chunks/node_modules_67e82ec7._.js:923:23
fulfilled@http://localhost:3000/_next/static/chunks/node_modules_67e82ec7._.js:276:32
Please Help me out i am trying to solve this from last 2-3 days but there is not single solution for this.
TL;DR
Issue: Error occurs when trying to create a new document in a collection with a new unique ID using Appwrite cloud and next.js with TypeScript. Despite using a unique ID generator, still receiving an error indicating the document already exists.
Solution: The error is due to the ID being duplicated. Ensure that the ID generated using ID.unique() is truly unique.Recommended threads
- Confused about the pricing. Can I get so...
I 'm really confused about the pricing here. I've got the pro plan and i have 4 projects open. As you can see, I'm nowhere near my usage limits with these proje...
- Request for JWKS Endpoint and OIDC Disco...
Hey Appwrite Team, Do you have plans to support JWKS and a well-known OIDC discovery endpoint? This would let us verify Appwrite JWTs in other services using st...
- Cloud 500 error