Closed denisprado closed 5 months ago
Same. I have not made any changes and now getting this error in build output.
In the webhook this line is the problem:
if (!sig || !webhookSecret) return
You actually need to throw an error here so that the error will be caught and a Response can be returned.
Like this:
if (!sig || !webhookSecret) throw new Error("Missing Stripe Signature or Webhook Secret!")
Thanks @jonkurtis it solved the issue 👍
Opened a PR to fix this issue.
I am getting the follow error when deploying to vercel:
Failed to compile. 16:09:50.139 | src/app/api/webhooks/route.ts 16:09:50.140 | Type error: Route "src/app/api/webhooks/route.ts" has an invalid export: 16:09:50.140 | "Promise<Response | undefined>" is not a valid POST return type: 16:09:50.140 | Expected "Response | Promise", got "Promise<Response | undefined>".
16:09:50.140 | Expected "Promise", got "Promise<Response | undefined>".
16:09:50.140 | Expected "Response", got "Response | undefined".
16:09:50.140 | Expected "Response", got "undefined".
`
but I have not changed this file. Any one guess what is happening?