New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Event
Web API
#293
Comments
I was able to get Stripe to work on Vercel's edge function by using a polyfill ( |
@thillmann Thank you so much! All my edge functions using stripe-node now work :) Still it would be nice if this could be added to Vercel's edge runtime. |
The Edge Runtime core is using event-target-shim which provides Maybe this was an issue in the past, but it seems like it's working as expected:
I'm going to close for now, but please feel free to comment if I'm missing something 🙏 |
@Kikobeats, I tried again without The error is |
@f-elix are you using Next.js or Vercel CLI? Also, if you do |
@Kikobeats I'm actually using Sveltekit and deploying with adapter-vercel. I indeed get |
@f-elix this is now fixed; can you check at your end? 🙂 |
I think this issue is still going on. Here is a error message from stripe-node
|
@Kikobeats Sorry for the delay! I'm still getting the same error: TypeError: Class extends value undefined is not a constructor or null
at (../../../../node_modules/stripe/esm/StripeEmitter.js:6:6)
at (../../../../.svelte-kit/vercel-tmp/fn/edge.js:13:7)
at (../../../../node_modules/stripe/esm/platform/WebPlatformFunctions.js:2:0)
at (../../../../.svelte-kit/vercel-tmp/fn/edge.js:13:7)
at (../../../../node_modules/stripe/esm/stripe.esm.worker.js:1:0)
at (../../../../.svelte-kit/vercel-tmp/fn/edge.js:13:7)
at (../../../../.svelte-kit/output/server/chunks/stripe.js:1:0)
at (../../../../.svelte-kit/vercel-tmp/fn/edge.js:13:7)
at (../../../../.svelte-kit/output/server/entries/pages/_locale_lang_/_slug_slug_signup_/_page.server.ts.js:9:0)
at (../../../../.svelte-kit/vercel-tmp/fn/edge.js:13:7) |
Hello, The original issue reported support for Now, both are working properly at production. source code: export const config = { runtime: 'edge' }
export default () => {
return Response.json({
queueMicrotask: !!queueMicrotask,
Event: !!Event,
EventTarget: !!EventTarget
})
} deployment: https://edge-api-one.vercel.app/api I tested manually in a project running Can you confirm at your end? 🙂 |
@Kikobeats Everything works now! No error, and logging |
Feature Request
Is your feature request related to a problem? Please describe.
I'm trying to deploy an edge function that uses the
stripe-node
package. Despite the name, it is possible to use it in other runtimes, such as Cloudflare workers and Deno. There is however a problem with Vercel edge functions because theEvent
API is not supported (see this issue: stripe/stripe-node#1732). An error is thrown whenever the function is invoked.You can reproduce the issue by deploying and edge function with the following code:
Describe the solution you'd like
Support the Event Web API, as it is part of WinterCG's Minimum Common Web Platform API proposal.
The text was updated successfully, but these errors were encountered: