Im starting a function, and when I try to parse the req.body it just doesnt work
I attached some images of my code
For example if I log(bodyParsed.userId) is just undefined
Am i doing something wrong?
Perhaps it's already parsed so you don't need to parse it again
appwrite automatically parses the req.body?
I know the error seems very dumb, but it gets very strange...
When I delete node-appwrite from the dependencies on the package.json and comment the import { Client } from 'node-appwrite', out of nowhere everything works, I can extract the userId from the req.body and the log(bodyParsed) shows as a JSON
when the node-appwrite from the package.json and import { Client } from 'node-appwrite' is present in the code it is impossible to parse the req.body, It remains as a string and recently the entire function stopped working for no reason with an error of:
Multiple internal curl errors has occurred within the executor! Error Number: 111. Error Msg: Connection refused\nError Code: 500
What could cause it?
Im using "node-appwrite": "^9.0.0", i will attach a photo of my package.json, my code and the new error that appears in the console in case that helps...
how are you executing the function?
Do you mean where I am running it from? I am using the appwrite interface, I will attach an image
This is the exact same both times you executed?
I managed to solve the error, I tried many things and I no longer know which one worked
but now it works, thanks steven
[SOLVED] function req.body problem
Recommended threads
- Sometimes this function shows an error l...
1. Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.\nError Code: 408 2...
- Custom Topic sent from Function (with sc...
Can I send a message on a custom topic? So clients can subscribe to them?
- Function scheduling is not functional on...
Hello everyone! I'm using Appwrite Cloud and I have a function that runs every day at 00:00 UTC. Preciously it worked fine, but it didn't fire last night and i...