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
TypeError: Class extends value undefined is not a constructor or null
at (entry.mjs:77:4827)
at (render:middleware.js:1:17)
vercel API failed, but the static page works.
**It also works well in my local machine, weird. **
vercel node version is 18.x
the stripe package version is "stripe": "^12.3.0"
To Reproduce
page/api/stripe.ts
importtype{APIRoute}from'astro';importStripefrom'stripe';conststripeKey: string=import.meta.env.STRIPE_APIKEY;constwebhookSecret: string=import.meta.env.STRIPE_WEBHOOK_SECRET;exportconstpost: APIRoute=async({ request })=>{constsignature=request.headers.get('Stripe-Signature');conststripe=newStripe(stripeKey,{// This is needed to use the Fetch API rather than relying on the Node http// package.apiVersion: '2022-11-15',});returnnewResponse(JSON.stringify({msg: 'ok'}),{status: 200});};
Env:
vercel API failed, but the static page works.
**It also works well in my local machine, weird. **
vercel node version is 18.x
the stripe package version is "stripe": "^12.3.0"
Expected behavior
it should work in vercel
Code snippets
// pages/api/stripe.tsimporttype{APIRoute}from'astro';importStripefrom'stripe';conststripeKey: string=import.meta.env.STRIPE_APIKEY;constwebhookSecret: string=import.meta.env.STRIPE_WEBHOOK_SECRET;exportconstpost: APIRoute=async({ request })=>{constsignature=request.headers.get('Stripe-Signature');conststripe=newStripe(stripeKey,{// This is needed to use the Fetch API rather than relying on the Node http// package.apiVersion: '2022-11-15',});returnnewResponse(JSON.stringify({msg: 'ok'}),{status: 200});};
OS
linux
Node version
Node 18.x
Library version
12.3.0
API version
2022-11-15
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hi @wanghsinche , this appears to be the same issue as #1732 that is caused by an internal class extending the Event Web API, which the Vercel edge runtime doesn't support yet. In the meantime, you can use a polyfill (event-target-polyfill) for the Event API as suggested in vercel/edge-runtime#293.
Hi @wanghsinche , this appears to be the same issue as #1732 that is caused by an internal class extending the Event Web API, which the Vercel edge runtime doesn't support yet. In the meantime, you can use a polyfill (event-target-polyfill) for the Event API as suggested in vercel/edge-runtime#293.
It works! Thank you so much and so quick reply!!! it is not easy to locate the reason. I struggled with it for a whole night without any progress. 😂
Describe the bug
vercel API failed, but the static page works.
**It also works well in my local machine, weird. **
vercel node version is 18.x
the stripe package version is "stripe": "^12.3.0"
To Reproduce
page/api/stripe.ts
Env:
Expected behavior
it should work in vercel
Code snippets
OS
linux
Node version
Node 18.x
Library version
12.3.0
API version
2022-11-15
Additional context
No response
The text was updated successfully, but these errors were encountered: