How to fix Stripe 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>)
Solution:
I downgraded Stripe to version 17.7.0, and it works!
Jump to solution
6 Replies
Ping
Ping2w ago
Do you have any code details to potentially share? This is not very descriptive.
Solution
TAM
TAM2w ago
I downgraded Stripe to version 17.7.0, and it works!
shadow
shadow2w ago
Hey, is your webhook running fine? I am getting problem with subs
TAM
TAMOP2w ago
no any problem.
shadow
shadow2w ago
can you check #Unable to get access to authClient.stripe.subscription @TAM
TAM
TAMOP2w ago
add: authorizeReference stripe({ stripeClient, stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!, createCustomerOnSignUp: true, subscription: { enabled: true, plans: [ { name: "pro", // the name of the plan, it'll be automatically lower cased when stored in the database priceId: process.env.NEXT_PUBLIC_STRIPE_MONTHLY_PRICE_ID, // the price id from stripe annualDiscountPriceId: process.env.NEXT_PUBLIC_STRIPE_YEARLY_PRICE_ID, // (optional) the price id for annual billing with a discount }, ], // updateUserMetadata: true, // Track subscription info in user metadata authorizeReference: async ({ user, session, referenceId, action }) => { try { // Check if the user has permission to manage subscriptions for this reference if ( action === "upgrade-subscription" || action === "cancel-subscription" ) { const [org] = await db .select() .from(schema.members) .where( sql${schema.members.organizationId} = ${referenceId} AND ${schema.members.userId} = ${user.id}, ) .limit(1) return org?.role === "owner" } return true } catch (error) { console.error("Error authorizing subscription reference:", error) return false } }, ....

Did you find this page helpful?