afterbuild/ops
ERR-498/Stripe · webhook
ERR-498
No signatures found matching the expected signature

appears when:After the app is deployed to Vercel and a live charge fails to update the database

Stripe webhook not firing

Dashboard shows no delivery or a red 'failed' badge. Cause is almost always the raw-body parse, a test-mode secret in production, or an endpoint URL still pointing at localhost.

Last updated 8 August 2026 · 8 min read · By Hyder Shah
Direct answer
Stripe webhook not firing is almost always one of three causes: endpoint URL wrong in the Stripe dashboard, STRIPE_WEBHOOK_SECRET missing in production env, or the Next.js route parsed JSON before signature verification. Use await request.text(), pass the raw string to stripe.webhooks.constructEvent, and confirm the live-mode endpoint is registered in the Stripe dashboard. Return 200 in under a second.

How do I fix Stripe webhook not firing?

app/api/stripe/webhook/route.ts
typescript
01// app/api/stripe/webhook/route.ts02import Stripe from "stripe";03import { NextRequest } from "next/server";04 05const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);06const secret = process.env.STRIPE_WEBHOOK_SECRET!;07 08export async function POST(req: NextRequest) {09  const body = await req.text(); // raw string, NOT .json()10  const sig = req.headers.get("stripe-signature")!;11 12  let event: Stripe.Event;13  try {14    event = stripe.webhooks.constructEvent(body, sig, secret);15  } catch (err) {16    return new Response(`Webhook Error: ${(err as Error).message}`, { status: 400 });17  }18 19  // Acknowledge fast, process async20  queueEvent(event); // push to Inngest / QStash / your queue21  return new Response("ok", { status: 200 });22}
Paste this into your webhook route — await req.text() preserves the raw body for signature verification

Not a developer? We fix this for you at a fixed price: $299 emergency triage, done in 48 hours or fully refunded. Not sure what else is broken? Send the repo for the $49 audit.

What if the quick fix doesn't work?

01 · Verify the endpoint URL is registered in live mode

Stripe dashboards are toggled between test and live. A webhook created while the toggle was on Test will not receive live events. Switch the toggle to Live mode → Developers → Webhooks → Add endpoint. Use the exact production URL. Copy the new whsec_ secret into Vercel and redeploy.

02 · Drop edge runtime from the webhook route

app/api/stripe/webhook/route.ts
typescript
01// ❌ DO NOT USE edge runtime for Stripe webhooks02// export const runtime = "edge";03 04// Stay on the default Node.js runtime so the Stripe SDK works05// (no directive needed)
Edge runtime strips body parsing and the Node crypto API — required by Stripe

03 · Add idempotency keyed on event.id

Stripe replays events on retry. Without an idempotency check your database sees the same subscription twice. Store event.id in a Postgres table with a unique constraint; short-circuit if the row already exists.

app/api/stripe/webhook/route.ts
typescript
01const { error } = await supabase02  .from("stripe_events")03  .insert({ id: event.id })04  .select()05  .single();06 07if (error?.code === "23505") {08  // already processed09  return new Response("duplicate", { status: 200 });10}

Three inputs, one error message — separating them by hand

stripe.webhooks.constructEvent() takes the request body, the Stripe-Signatureheader, and the endpoint secret, and Stripe’s documentation states that the verification error means at least one of those three is incorrect. The message does not say which. Anyone reading No signatures found matching the expected signature for payloadas “wrong secret” is reading a guess into it, which is how a raw-body bug survives three secret rotations.

  1. Signature. Print the header. Stripe documents its shape as t=xxx,v1=yyy,v0=zzz. Anything else means the header was mangled on the way in — a proxy stripping it, or the wrong header name being read.
  2. Body. Print body.length and compare it against the payload size Stripe shows for that delivery attempt. A mismatch of even one byte is a parse or re-encode, and the culprit is upstream of your handler.
  3. Secret. Print the last four characters of the secret actually loaded at runtime and compare against the value revealed on that specific endpoint. Never log the whole secret.

Which secret is in your env right now?

The CLI secret and the Dashboard endpoint secret are the trap, because they are visually indistinguishable. Stripe’s documentation is direct about it: in both cases the secret starts with a whsec_prefix but the secret itself is different, and it warns against verifying CLI-forwarded events with a Dashboard endpoint’s secret or the reverse. The CLI prints its secret to the terminal when you run stripe listen; the Dashboard hides its own behind Reveal secret on the endpoint page.

The failure mode is asymmetric and that is what makes it durable. A developer who pasted the stripe listen value into .envhas a local loop that verifies perfectly, so the code looks correct under every local test, and only the deployed endpoint rejects deliveries. Every endpoint you create carries its own secret — there is no single account-wide value — so an environment with two endpoints needs two secrets, and “the Stripe webhook secret” is not a thing that exists.

Why Express fails on ordering rather than on code

Stripe’s guidance for Express is a sequencing rule, not an API one: place app.use(express.json()) after the webhook route, because middleware order decides whether the body reaches your handler intact. Applied before the route, it parses the body ahead of signature verification and the check fails. The same shape governs every framework that parses eagerly — the Next.js App Router avoids it only because nothing parses the request until you ask it to.

Tried the fix and still broken?

Send your app URL. A senior engineer records a 10-minute teardown.

Free, and fully async — no call to book. A senior engineer walks your app on video: what’s broken, what’s risky, what to fix first. In your inbox within 24 hours. Want the code read line by line instead? Send the repo for the $49 audit.

Why do AI-built apps hit Stripe webhook not firing?

AI builders treat Stripe as a scaffolding checklist — one route handler, one test charge, one success toast. The shape works in preview because every preview hits the test-mode webhook that was registered during the onboarding wizard. The bug is silent because test-mode traffic never reveals the live-mode gap.

Vercel compounds the issue. Environment variables are scoped per environment, and NEXT_PUBLIC_ values bake into the bundle at build time. A founder who updates Preview but not Production ships a half-configured integration. Stripe Node SDK requires the Node runtime, so an inherited export const runtime = "edge" on the webhook route also breaks signature verification.

The fix pattern is always the same: register the live endpoint, scope the secret to Production, read the body raw, acknowledge in under a second, and enqueue the real work. Deploy once with that shape and Stripe webhook not firing stops recurring.

Which AI builders ship Stripe webhook not firing?

How often each AI builder ships this error and the pattern that produces it.

AI builder × Stripe webhook not firing
BuilderFrequencyPattern
LovableEvery Stripe scaffoldCalls request.json() before verify
Bolt.newEvery Stripe scaffoldEdge runtime default breaks Node crypto
v0CommonShips test-mode secret, never creates live endpoint
CursorSometimesGenerates Express-style middleware that strips body
Replit AgentCommonOmits STRIPE_WEBHOOK_SECRET from deploy checklist
Base44RareSwallows verification error with generic 500

How do I stop Stripe webhook not firing recurring?

Still stuck with Stripe webhook not firing?

Emergency triage · $299 · 48h turnaround
We restore service and write the root-cause report.
start the triage →

Stripe webhook not firing questions

Why does the signature check fail even when the secret is correct?+
Because the secret is only one of three inputs, and the payload is the one that gets corrupted silently. Stripe signs the exact bytes it sent, and its documentation is explicit that the request body must be the body string Stripe sends in UTF-8 encoding without any changes — it lists adding or removing whitespace, reordering key-value pairs, converting the string to JSON, and changing the encoding as changes that all lead to a failed verification. A framework that JSON-parses by default performs several of those before your handler runs, so the secret can be perfect and verification still fails. That is why the fault is concentrated in frameworks that parse eagerly and absent in ones that hand you the raw stream.
Which Next.js App Router config preserves the raw body?+
None — there is no config to set, which is what trips up people carrying Pages Router habits across. In the App Router a Route Handler receives a standard Request, and nothing has parsed it until you choose to: call await request.text() and pass that string to stripe.webhooks.constructEvent. The old `export const config = { api: { bodyParser: false } }` belongs to Pages Router API routes and does nothing in a route.ts file. Stripe maintains separate worked examples for the two routers in stripe-node, which is the tell that the mechanism differs rather than the syntax.
How do you tell a raw-body failure from a wrong-secret failure from the log line alone?+
You cannot, and assuming otherwise is what turns a ten-minute fix into an afternoon. Stripe's documentation states that if you get the 'Webhook signature verification failed' error, at least one of the three parameters passed to constructEvent() is incorrect — the request body, the signature header, or the endpoint secret. One message, three possible causes, no discriminator in the text. Separate them by hand: print the signature and confirm it has the shape t=xxx,v1=yyy,v0=zzz, print the length of the raw body string and compare it against the byte count Stripe shows for that delivery, and print the last four characters of the secret in use against the one revealed in the Dashboard.
Does the CLI-forwarded secret differ from the Dashboard endpoint secret?+
Yes, and this is the near-invisible variant because both secrets look identical at a glance. Stripe's documentation notes that in both cases the secret starts with a whsec_ prefix but the secret itself is different, and warns against verifying events forwarded by the CLI using the secret from a Dashboard-managed endpoint or the other way around. The CLI prints its secret in the terminal when you run stripe listen; the Dashboard reveals its own behind 'Reveal secret' on the endpoint. A developer who ran stripe listen last week and pasted that value into .env has a working local loop and a production endpoint that rejects every delivery.
Why is my Stripe webhook not firing in production?+
Three common causes: a wrong endpoint URL registered in the Stripe dashboard, a missing STRIPE_WEBHOOK_SECRET in production env, or a webhook created in test mode while the app runs live. Check Stripe → Developers → Webhooks first. A red 'failed' badge confirms delivery is rejected; no events at all means the URL is wrong or the endpoint never runs.
How do I know if Stripe is even trying to send the webhook?+
Stripe Dashboard → Developers → Webhooks → your endpoint → 'Recent deliveries'. Each attempt shows the HTTP status your server returned. 404 = URL wrong. 400 = signature verification failed. 500 = handler crashed. No entries means Stripe never fired an event — wrong event type or test-mode/live-mode mismatch.
What does 'No signatures found matching the expected signature' mean?+
stripe.webhooks.constructEvent throws this when the raw request body was altered before verification. Next.js App Router, Express body-parser, and most frameworks parse JSON by default — that breaks the signature. In Next.js 16 App Route Handlers use await request.text(), never await request.json().
Do I need separate Stripe webhook secrets for test and live?+
Yes. Each endpoint in the Stripe dashboard has its own signing secret, and test-mode and live-mode endpoints are separate. Both secrets start with the same whsec_ prefix and only the value differs, so you cannot tell them apart by eye — reveal each one in its own endpoint's dashboard page and store them in different Vercel scopes so preview hits test and production hits live.
Can a Vercel cold start cause the webhook to fail?+
Cold starts rarely cause outright failure but can trip Stripe's 10-second timeout on a first invocation. If the Stripe dashboard shows 'failed — timeout', move slow work out of the handler. Acknowledge with 200 immediately then enqueue processing via Inngest, QStash, or a DB queue. Never run a 5-second API call synchronously inside a Stripe webhook handler.
Next step

Ship the fix. Keep the fix.

Emergency Triage restores service in 48 hours. Break the Fix Loop rebuilds CI so this error cannot ship again.

About the author

Hyder Shah leads Afterbuild Labs, shipping production rescues for apps built in Lovable, Bolt.new, Cursor, Replit, v0, and Base44. our rescue methodology.

Sources