"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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...