From b179c0d91a8e93cd0d259d4540801a8dc64eeea0 Mon Sep 17 00:00:00 2001 From: Alexander Klusa <71306750+aklusa022@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:29:40 -0600 Subject: [PATCH 1/3] Document known issues and fixes for Stripe integration Added known issues and mitigations for Stripe createCustomerOnSignUp error, including installation of the Buffer package and necessary code adjustments. --- docs/content/docs/features/local-install.mdx | 109 +++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/docs/content/docs/features/local-install.mdx b/docs/content/docs/features/local-install.mdx index 9567a5b..4f90b64 100644 --- a/docs/content/docs/features/local-install.mdx +++ b/docs/content/docs/features/local-install.mdx @@ -269,3 +269,112 @@ export const someFunction = query({ }, }); ``` + +# Known Issues & Mitigations + + +## Stripe createCustomerOnSignUp CONVEX Uncaught ReferenceError Fix + +Example of error: +```ts +11/15/2025, 2:49:55 PM [CONVEX H(GET /api/auth/callback/github)] [LOG] '2025-11-15T20:49:55.811Z INFO [Better Auth]: [Convex Adapter]' '#5 \x1B[40m\x1B[33m[4/4]\x1B[0m' '\x1B[1mcreate\x1B[0m \x1B[2m(Parsed Result)\x1B[0m:' { + model: 'user', + data: { + name: 'Alexander K', + email: 'xxxxx@gmail.com', + emailVerified: true, + image: 'https://avatars.githubusercontent.com/u/xxxxxx', + createdAt: 1763239795775, + updatedAt: 1763239795775, + userId: undefined, + stripeCustomerId: undefined, + id: '12345234234' + } +} +11/15/2025, 2:49:55 PM [CONVEX H(GET /api/auth/callback/github)] Uncaught ReferenceError: Buffer is not defined +``` + +This usually occurs when passing +```ts +createCustomerOnSignUp: true +``` +in the @betterauth/stripe plugin initialization in convex/auth.ts +```ts +plugins: [ + // The Convex plugin is required for Convex compatibility + + convex(), + stripe({ + createCustomerOnSignUp: true, + stripeClient: stripeClient, + stripeWebhookSecret: "xxxxxx" + }), + + ], +``` + +### The fix: + +