
What exactly was the trace?
Did you see the execution start in the Appwrite console?

sorry, I have deleted the function and rewrote it using the Deno SDK. But what does happen on every script I write is, if it throws and error, I will see only an "Internal Server Error" message in the Error tab of the appwrite function's dashboard.

for the error I was having the error message was empty. The only information I had was that it happened in the function that tries to make a request to execute the function I requested in the appwrite's api.

gonna create a function to reproduce the issue for ya

it didn't work with the Deno's SDK either though, I had to do a workaround that would cost me more one request xD

Just an example

sorry for taking too long

/*
'req' variable has:
'headers' - object with request headers
'payload' - request body data as a string
'variables' - object with function variables
'res' variable has:
'send(text, status)' - function to return text response. Status code defaults to 200
'json(obj, status)' - function to return JSON response. Status code defaults to 200
If an error is thrown, a response with code 500 will be returned.
*/
export default async function (request: any, response: any) {
throw new Error(
'Environment variables are not set. Function cannot use Appwrite SDK.',
)
}

and this is what I get in the errors tab

if I don't catch the error and send it in the response, I'll have no idea of what went wrong xD

For now, it's best to always make sure you catch exceptions and return a response

How did you initialize and deploy your function?

appwrite init function

appwrite deploy function

one important thing I gotta ask you though is: do you know why the headers variable may be empty?

I tried Deno and PHP SDK's

I always get an empty array

Yes, they're always empty

I created a function to receive updates from Stripe webhook but I need the stripe-signature header to confirm the message belongs to Stripe

mmm

guess I gonna need to attach it to the body in the proxy layer then

Yes. Here's one that does that: https://github.com/BoolCode/appwrite-funcover

yeah, I just saw yours after creating mine XD https://github.com/ssa-web-solutions/appwrite-functions-proxy Not as professional as yours but works (it's lacking an auth layer though)

This isn't mine btw. It's made by byawitz. Mine isn't as good 😅

XD
Recommended threads
- @kenny
Thank you for helping me. Everyone is entering code and I am stuck. I watched a vid, to use AW with VS and console. I am just starting to follow 100dev, and kno...
- problems logging out
Good day! I started developing a website, wrote the registration and authorization, but I have a problem with roles. I haven't used them and don't understand ho...
- Error on upload file "Param "fileId" is ...
Hey everyone, I am using appwrite version 1.6.0 self-hosted with coolify. I want to switch back to the cloud env but at the moment we are in a concept phase an...
