
I have a simple function that gets the transcriptId
param but for some reason I get TypeError: error is not a function
? I thought this is how your supposed to use error
and log
?
import { Client, Databases } from 'node-appwrite';
import { throwIfMissing } from './utils.js';
export default async ({ req, res, log, error }) => {
try {
if (req.method === 'GET') {
const transcriptId = req.bodyJson.transcriptId;
if (!transcriptId) {
error("Missing transcriptId parameter");
return res.json({ error: "Missing transcriptId" }, 400);
}
} else {
return res.json({ error: "Method not allowed" }, 405);
}
} catch (e) {
error("Function error:", e);
return res.json({ error: "Internal server error: " + e.message }, 500);
}
};

In the logs, it does say to use context.log()
or context.error()
but how would I get the context
property?
Recommended threads
- Every time I deploy a function via CLI, ...
deploying appwrite function via cli breaks Git connection in function settings tab but when I push to git triggered deployment fail. usually multiple deployment...
- A way to configure cloud function config...
Is there a way to configure cloud functions locally and keep that in github and deploy from source control instead of manually configuring it from the console f...
- Cannot create a user
Hi, I am using a lowcoder frontend and trying to create a user in Appwrite (python function). Unfortunately, all I got is an error: "Raw body: Error". It means...
