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.exports
orexports
syntax to expose functions or objects to other files. For instance: - Double-check your
package.json
file. 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_modules
directory.
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
- 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...