"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
- Appwrite Fra Cloud Custom Domains Issue
I’m trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
- Appwrite service :: getCurrentUser :: Us...
Getting this error while creating a react app can someone please help me solve the error
- Storage & Database is not allowing.
Storage & Database is not allowing to CRUD after i have logged in ? Using web SDK with next.js without any SSR or node-sdk.
