You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have an edge function that uses the node-onesignal package to send an email.
If I run it with supabase functions serve it starts fine, but when it's triggered (by curl for my testing) serve reports a segfault and exits.
The function works as expected when:
run with deno run --allow-net <path> and triggered by navigating to localhost:8000
deployed, then triggered by a webhook
It segfaults on await onesignal.createNotification(notification). If I comment that line out everything else works as expected.
To Reproduce
Create a new function
supabase functions new my-function
Replace my-function/index.ts with
import*asOneSignalfrom"https://esm.sh/@onesignal/node-onesignal@2.0.1-beta2";console.log("Hello from Functions!");const_OnesignalAppId_="my_onesignal_app_id";const_OnesignalUserAuthKey_="my_onesignal_userauth_key";const_OnesignalRestApiKey_="my_onesignal_rest_api_key";constonesignal=newOneSignal.DefaultApi(OneSignal.createConfiguration({userKey: _OnesignalUserAuthKey_,appKey: _OnesignalRestApiKey_,}));Deno.serve(async()=>{constnotification=newOneSignal.Notification();notification.app_id=_OnesignalAppId_;notification.include_email_tokens=["myemail@test.com"];notification.email_body="Body";notification.email_subject="Subject";console.log("Sending");awaitonesignal.createNotification(notification);// <-- This triggers the segfaultconsole.log("Sent");returnnewResponse();});
Similar problem here. For me, it worked fine with the CLI version 1.106.1 but when I tried to upgrade it always lead to me getting the segfault. I am not using a third party package, though. Just making fetch calls to some APIs. Possibly related to #199 , #200 and #204 ?
Describe the bug
I have an edge function that uses the
node-onesignal
package to send an email.If I run it with
supabase functions serve
it starts fine, but when it's triggered (by curl for my testing)serve
reports a segfault and exits.The function works as expected when:
deno run --allow-net <path>
and triggered by navigating to localhost:8000It segfaults on
await onesignal.createNotification(notification)
. If I comment that line out everything else works as expected.To Reproduce
my-function/index.ts
withExpected behavior
I would expect:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: