Rank 1: Thread
AppwriteException {
name: 'AppwriteException',
code: 500,
type: 'general_unknown',
response: {
message: 'Server Error',
code: 500,
type: 'general_unknown',
version: '0.11.4'
},
stack: 'AppwriteException: Server Error\n' +
' at Client.eval (webpack-internal:///(app-client)/./node_modules/appwrite/dist/esm/sdk.js:410:27)\n' +
' at Generator.next (<anonymous>)\n' +
' at fulfilled (webpack-internal:///(app-client)/./node_modules/appwrite/dist/esm/sdk.js:41:58)',
message: 'Server Error'
}
getting this error when creating a new document.
was working fine till now.
Function that creates the trip defined in zustand store
createTrip: async (trip) => {
try {
let file: Image | undefined;
if (trip.image) {
const fileUploaded = await uploadImage(trip.image, process.env.NEXT_PUBLIC_TRIP_BANNER_IMAGE_BUCKET_ID!);
if (fileUploaded) {
file = {
bucketId: fileUploaded.bucketId,
fileId: fileUploaded.$id,
};
}
}
const response = await databases.createDocument(
process.env.NEXT_PUBLIC_TRIPARCHITECT_DATABASE_ID!,
process.env.NEXT_PUBLIC_TRIPS_COLLECTION_ID!,
ID.unique(),
{
name: trip.name,
startDate: trip.startDate,
endDate: trip.endDate,
creator: trip.creator,
...(file && { image: JSON.stringify(file) }),
}
);
return response as Models.Document;
} catch (error) {
console.log(error);
} finally {
set(() => ({
isOpen: false,
imageFile: null,
tripName: "",
tripStartDate: "",
tripEndDate: "",
}));
}
},