dD0K
dD0K
Explore posts from servers
BABetter Auth
Created by dD0K on 3/3/2025 in #bug-reports
Stripe Plugin bug
authClient.subscription.upgrade() does not work with prisma, it says a column is missing even though the prisma studio shows it exists, the neon dashboard says it exists, and I can access the field using the prisma adapter in my code no problem.
# SERVER_ERROR: [Error [PrismaClientValidationError]:
Invalid `db[getModelName(model)].create()` invocation in
/home/dd0k/prog/site/.next/server/chunks/node_modules_better-auth_dist_27182c5e._.js:2804:62

2801 if (!db[getModelName(model)]) {
2802 throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$better$2d$auth$2f$dist$2f$shared$2f$better$2d$auth$2e$DdzSJf$2d$n$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__["B"](`Model ${model} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
2803 }
→ 2804 const result = await db[getModelName(model)].create({
data: {
id: "El1Rxk2gbJK2QEPIr7dsBzcukjN2rBc3",
plan: "basic",
referenceId: "oFzjRP9pngfBpN7lYf54aSdzU34NrWds",
stripeCustomerId: "cus_Rs3OupAOBNGKM7",
status: "incomplete",
seats: 1,
+ stripeSubscriptionId: String
},
select: undefined
})

Argument `stripeSubscriptionId` is missing.] {
clientVersion: '6.4.1'
}
POST /api/auth/subscription/upgrade 500 in 3275ms
# SERVER_ERROR: [Error [PrismaClientValidationError]:
Invalid `db[getModelName(model)].create()` invocation in
/home/dd0k/prog/site/.next/server/chunks/node_modules_better-auth_dist_27182c5e._.js:2804:62

2801 if (!db[getModelName(model)]) {
2802 throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$better$2d$auth$2f$dist$2f$shared$2f$better$2d$auth$2e$DdzSJf$2d$n$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__["B"](`Model ${model} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
2803 }
→ 2804 const result = await db[getModelName(model)].create({
data: {
id: "El1Rxk2gbJK2QEPIr7dsBzcukjN2rBc3",
plan: "basic",
referenceId: "oFzjRP9pngfBpN7lYf54aSdzU34NrWds",
stripeCustomerId: "cus_Rs3OupAOBNGKM7",
status: "incomplete",
seats: 1,
+ stripeSubscriptionId: String
},
select: undefined
})

Argument `stripeSubscriptionId` is missing.] {
clientVersion: '6.4.1'
}
POST /api/auth/subscription/upgrade 500 in 3275ms
7 replies
BABetter Auth
Created by dD0K on 3/2/2025 in #help
Beta testing stripe plugin
Hey! I'm trying to follow these: https://www.better-auth.com/docs/plugins/stripe instructions to get the stripe plugin working, but I get stuck at the db migration step, here's the error I'm getting:
npx @better-auth/cli generate
2025-03-02T08:26:29.329Z ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Neither apiKey nor config.authenticator provided
at Stripe._setAuthenticator (file:///home/dd0k/prog/site/node_modules/stripe/esm/stripe.core.js:163:23)
at new Stripe (file:///home/dd0k/prog/site/node_modules/stripe/esm/stripe.core.js:99:14)
at /home/dd0k/prog/site/lib/auth.ts:7:22
at async Function.import (/home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:199772)
at async resolveConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/c12/dist/shared/c12.PQMoYrit.mjs:346:18)
at async loadConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/c12/dist/shared/c12.PQMoYrit.mjs:146:23)
at async getConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/@better-auth/cli/dist/index.mjs:234:30)
at async Command.generateAction (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/@better-auth/cli/dist/index.mjs:643:18)
npx @better-auth/cli generate
2025-03-02T08:26:29.329Z ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Neither apiKey nor config.authenticator provided
at Stripe._setAuthenticator (file:///home/dd0k/prog/site/node_modules/stripe/esm/stripe.core.js:163:23)
at new Stripe (file:///home/dd0k/prog/site/node_modules/stripe/esm/stripe.core.js:99:14)
at /home/dd0k/prog/site/lib/auth.ts:7:22
at async Function.import (/home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:199772)
at async resolveConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/c12/dist/shared/c12.PQMoYrit.mjs:346:18)
at async loadConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/c12/dist/shared/c12.PQMoYrit.mjs:146:23)
at async getConfig (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/@better-auth/cli/dist/index.mjs:234:30)
at async Command.generateAction (file:///home/dd0k/.npm/_npx/167ca1f116d365e6/node_modules/@better-auth/cli/dist/index.mjs:643:18)
I'm using prisma connected to a neon db, any help is appreciated!
21 replies
TTCTheo's Typesafe Cult
Created by dD0K on 12/31/2024 in #questions
Help with webpack error
Hello! Could anyone that gets nextjs help me understand this error I get when running npm run build:
Failed to compile.

./app/page.tsx + 1 modules
Unexpected end of JSON input


> Build failed because of webpack errors
error: script "build" exited with code 1
Failed to compile.

./app/page.tsx + 1 modules
Unexpected end of JSON input


> Build failed because of webpack errors
error: script "build" exited with code 1
It only happens when I try to link a component from my /app/components directory into my page.tsx. npm run dev works fine with no errors, and deploying on vercel also works fine, it's just building locally that's the issue.
26 replies