Back

Please help, I'm stuck.. I'm unable to fetch data from the database of my project

  • 0
  • Databases
Stephanie036
20 Nov, 2024, 16:34

Up until a couple minutes ago the function on my code worked correctly but now my project breaks while trying to fetch the data. I can see the data on appwrite site but I'm unable to fetch it from my project

this is the error that I get An error occurred while retrieving the recent appointments: AppwriteException [Error]: fetch failed at Client.call (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/client.js:195:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Databases.listDocuments (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/services/databases.js:1658:16) at async $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/appointment.actions.ts:46:30) at async AdminPage (webpack-internal:///(rsc)/./app/admin/page.tsx:24:26) { code: undefined, type: undefined, response: undefined }

this is the code const appointments = await databases.listDocuments( DATABASE_ID!, APPOINTMENT_COLLECTION_ID!, [Query.orderDesc('$createdAt')] ); console.log('after bd call');

what am i missing? could somebody help me please? *DATABASE_ID and APPOINTMENT_COLLECTION_ID are correct

TL;DR
Developers cannot fetch data from the database of their project using Appwrite cloud. The code was working fine until now, but an error (fetch failed) is occurring. The data can be seen on the Appwrite site but cannot be fetched. The error message includes an AppwriteException and a failed fetch attempt. Solution: Double-check the code and ensure all parameters are correctly configured. Check the code for any recent changes that might have caused this issue. Additionally, review the error logs and verify the connection to the Appwrite cloud service.
D5
20 Nov, 2024, 16:43

Are you using Appwrite cloud?

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