so i created a simple sendEmail function in my nodeJS env, it all works locally when I try to deploy the code to an appwrite function, I get the following error
TypeError: userFunction is not a function at /usr/local/src/server.js:68:19 at processTicksAndRejections (node:internal/process/task_queues:96:5)
I check the folder, structure I made use I uploaded it in the right folder structure along with all dependencies the function needs to run, made sure it is pointing to the right place, but I don't know how to resolve this
I am not sure I need to give anymore information than this but if I do I am more than happy to
Hi, can you try looking through this once? https://stackoverflow.com/questions/33865068/typeerror-is-not-a-function-in-node-js
Some additional checks:
- Ensure your function's entry point is correct.
- Ensure that you're exporting your function correctly. In Node.js, you typically use the
module.exportsorexportssyntax to expose functions or objects to other files. For instance: - Double-check your
package.jsonfile. Ensure all your required dependencies are listed and are uploaded alongside your function. - Sometimes, the error might arise due to how files are zipped. The zipped folder should not contain another folder that then contains your code. It should directly contain your main JS files, other necessary files, and the
node_modulesdirectory.
And always check the logs. Appwrite provides logs. Check those logs for more details on the error or any other information that might help.
If you've gone through all these steps and are still facing the issue, please provide more information or code snippets, so we can dive deeper into the problem.
okay thank you so much let me look into this, i appreciate the help
If you aren't able to fix the issue, feel free to share your function code to see if there's an issue!
Recommended threads
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Selfhosted starter python function retur...
I am running a selfhosted appwrite instance. Creating a node function and executing it works just fine but when i try to execute a python starter function, i ge...