Stripe Plugin webhook error
Getting this error in better auth stripe webhook :
2025-04-16T20:24:59.891Z ERROR [Better Auth]: Stripe webhook failed. Error: Invalid time value
POST /api/auth/stripe/webhook 200 in 175ms
POST /api/auth/stripe/webhook 200 in 14ms
POST /api/auth/stripe/webhook 200 in 14ms
POST /api/auth/stripe/webhook 200 in 13ms
2025-04-16T20:25:01.676Z ERROR [Better Auth]: Error fetching subscription from Stripe RangeError: Invalid time value
at Date1.toISOString (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
In stripe there is no error. Checkout is finalized successfully.
Does enyone knows what casues this error and how to fix it ?
2 Replies
Solution
use stripe sdk version v17.7.0, anything above is not supported yet
npm
stripe
Stripe API wrapper. Latest version: 18.0.0, last published: 15 days ago. Start using stripe in your project by running
npm i stripe
. There are 1852 other projects in the npm registry using stripe.