"message": "Server Error", "code": 500, "type": "general_unknown", While fetching documents
- 0
- Web
i am not able to fetch documents from appwrite collection
throwing this type of error:
{
"message": "Server Error",
"code": 500,
"type": "general_unknown",
"version": "0.12.101"
}
This is the code please help
` import { Query, database } from '@/providers/AppwriteClient' import { AppwriteException } from 'appwrite'; import React from 'react'
const getUserByUserID = async (userID: string) => { try {
const response = await database.listDocuments(String(process.env.NEXT_PUBLIC_DATABASE_ID), String(process.env.NEXT_PUBLIC_COLLECTION_ID_USERS), [Query.equal('userid', userID)]);
const document = response.documents;
return {
id: document[0].$id,
userid: document[0].userid,
username: document[0].username,
email: document[0].email,
profileImage: document[0].profileImage
}
} catch (error: AppwriteException | any) {
console.error(error.message);
throw new Error(error)
}
}
export default getUserByUserID`
i think queries are not working
Recommended threads
- Project Inactivity Clarification
I'm on appwrite free plan with my account (om.thakkar@ivcventure.com). Even though throughout the week we use the project atleast once to upload dynamic content...
- [ENHANCEMENT] Use the custom Next.js dep...
Deployment adapters on Next.js are now stable! This means that we don't have to stick to the limitations of sniffing out build outputs and manually moving or mo...
- NextJS builds sudden runtime_timeout
My builds suddenly stopped working. Activating old prebuilt snapshots work, but redeploying that same code produces builds that throw runtime_timeout FRA region