-
Notifications
You must be signed in to change notification settings - Fork 91
Description
I am using a webhook to handle successful payments through Stripe in my project. While this would work locally, I get an error after I deploy with nuxthub and change the setting in Stripe to target my hosted endpoint.
The full error I get is:
POST 500 /api/stripe/webhook
[nuxt] [request error] [unhandled] [500],Class extends value #<Object> is not a constructor or null
at chunks/routes/api/stripe/webhook.mjs:1:188650
According to docs, some librairies may not be compatible with the edge runtime yet. Even though I didn't locate the exact library causing this, this could be the case as it matches the 500 error returned. I have 3 libraries being used in my webhook code that could be causing this.
One is Stripe of course, second is supabase which I use to get final products and lastly nodemailer, used to send mail to the customer.
Steps to reproduce
Steps to reproduce the behavior:
- Create a basic webhook endpoint
- Deploy to cloudflare with nuxthub and target with stripe
- Trigger endpoint with a test payment
- See error
Expected behavior
Hosted webhook endpoint should work the same as when tested locally.