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
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...
- Suspicious access pattern detected when ...
Hello, I am having trouble restoring my project. In the past it worked with no problems, but today I get an error "Suspicious access pattern detected". How can ...