Skip to content
Back

Database Double Requesting Error.

  • 1
  • Databases
  • Web
  • Cloud
Jenil Desai
4 Jul, 2025, 11:07

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.
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