BUG: TypeScript errors — Stripe API version mismatch (tsc --noEmit fails) #4

Closed
opened 2026-05-09 00:26:50 +00:00 by Mark · 0 comments
Owner

Description

Running npx tsc --noEmit produces 2 TypeScript errors in the billing route files:

src/app/api/billing/route.ts(9,3): error TS2322: Type '"2026-04-22.dahlia"' is not assignable to type '"2026-03-25.dahlia"'.
src/app/api/billing/webhook/route.ts(9,3): error TS2322: Type '"2026-04-22.dahlia"' is not assignable to type '"2026-03-25.dahlia"'.

Cause

Both files specify apiVersion: "2026-04-22.dahlia" when initializing Stripe, but the installed stripe package (v22.0.1) only defines type definitions for "2026-03-25.dahlia".

Impact

  • tsc --noEmit fails, which means the CI "typecheck" job in .forgejo/workflows/ci.yml would fail
  • However, next build still succeeds because Next.js has looser type checking

Fix

Either:

  1. Change the API version to match the Stripe package: "2026-03-25.dahlia"
  2. Or update the stripe npm package to a version that supports the newer API version
## Description Running `npx tsc --noEmit` produces 2 TypeScript errors in the billing route files: ``` src/app/api/billing/route.ts(9,3): error TS2322: Type '"2026-04-22.dahlia"' is not assignable to type '"2026-03-25.dahlia"'. src/app/api/billing/webhook/route.ts(9,3): error TS2322: Type '"2026-04-22.dahlia"' is not assignable to type '"2026-03-25.dahlia"'. ``` ## Cause Both files specify `apiVersion: "2026-04-22.dahlia"` when initializing Stripe, but the installed `stripe` package (v22.0.1) only defines type definitions for `"2026-03-25.dahlia"`. ## Impact - `tsc --noEmit` fails, which means the CI "typecheck" job in `.forgejo/workflows/ci.yml` would fail - However, `next build` still succeeds because Next.js has looser type checking ## Fix Either: 1. Change the API version to match the Stripe package: `"2026-03-25.dahlia"` 2. Or update the `stripe` npm package to a version that supports the newer API version
Mark closed this issue 2026-05-09 16:12:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AuWoMe/planish#4
No description provided.