Sebastian
Sebastian
Explore posts from servers
BABetter Auth
Created by Sebastian on 4/28/2025 in #help
Im using the better-auth in a non-nextjs server to verify session and see this error.
Im passing headers
const session = await this.authService.getAuth().api.getSession({
headers: this.authService.getFromNodeHeaders()(req.headers),
});
const session = await this.authService.getAuth().api.getSession({
headers: this.authService.getFromNodeHeaders()(req.headers),
});
5 replies
BABetter Auth
Created by Sebastian on 4/28/2025 in #help
Im using the better-auth in a non-nextjs server to verify session and see this error.
how can I fix this? Seems like better-auth it's trying to import next/headers in a non next-js environment. This should not happen
5 replies
BABetter Auth
Created by Sebastian on 4/16/2025 in #help
Using custom schema for models, with prisma adapter.
ok, I guess for the prisma adapter, your workaround would work. I see it doesn't have any schema parameter
9 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
Wow, for anybody else who can't read like me, the solution is in the error message. Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs apparently it's a known issue and it's even a workaround plugin from prisma for monorepos.
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
yeah, that's how I defined the database package in my monorepo
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
They displayed this as an example for how to setup turborepo with prisma https://turbo.build/repo/docs/handbook/tools/prisma
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
So @prisma/client is only installed in @kleerk/database, and it has an index.ts which does
export * from "@prisma/client"
export * from "@prisma/client"
The basic example on turborepo prisma docs. Then the initialization is done in the other packages which want to use PrismaClient. At build time, it depends on a "db:generate" which generates the client and types for prisma
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
This is the error displayed in vercel logs. This is the initialization in the apps/web The error comes after trying to import prisma in a /pages folder in order to use it in getServerSideProps for doing a check. However, the blocker is the displayed error.
import { PrismaClient } from "@kleerk/database";

declare global {
var prisma: PrismaClient | undefined;
}

export const prisma = global.prisma || new PrismaClient();

if (process.env.NODE_ENV !== "production") global.prisma = prisma;
import { PrismaClient } from "@kleerk/database";

declare global {
var prisma: PrismaClient | undefined;
}

export const prisma = global.prisma || new PrismaClient();

if (process.env.NODE_ENV !== "production") global.prisma = prisma;
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
PrismaClientInitializationError: Your schema.prisma could not be found, and we detected that you are using Next.js.
Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs
at new pr (/var/task/apps/web/.next/server/chunks/2300.js:112:10787)
at Na (/var/task/apps/web/.next/server/chunks/2300.js:115:1589)
at new t (/var/task/apps/web/.next/server/chunks/2300.js:128:4651)
at 19097 (/var/task/apps/web/.next/server/chunks/9097.js:1:206)
at __webpack_require__ (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:146)
at 38703 (/var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1496)
at __webpack_require__ (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:146)
at __webpack_exec__ (/var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1813)
at /var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1846
at __webpack_require__.X (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:1610) {
clientVersion: '5.3.1',
errorCode: undefined
}
PrismaClientInitializationError: Your schema.prisma could not be found, and we detected that you are using Next.js.
Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs
at new pr (/var/task/apps/web/.next/server/chunks/2300.js:112:10787)
at Na (/var/task/apps/web/.next/server/chunks/2300.js:115:1589)
at new t (/var/task/apps/web/.next/server/chunks/2300.js:128:4651)
at 19097 (/var/task/apps/web/.next/server/chunks/9097.js:1:206)
at __webpack_require__ (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:146)
at 38703 (/var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1496)
at __webpack_require__ (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:146)
at __webpack_exec__ (/var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1813)
at /var/task/apps/web/.next/server/pages/api/auth/[...nextauth].js:1:1846
at __webpack_require__.X (/var/task/apps/web/.next/server/webpack-api-runtime.js:1:1610) {
clientVersion: '5.3.1',
errorCode: undefined
}
13 replies
TTCTheo's Typesafe Cult
Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
I have a package in /packages named database, which exports * from '@prisma/client' I have setup the package.json right, I can work with the database package locally and while developing, I checked that the client is generated after removing node_modules, bun.lockb and simulate the build process.
13 replies
DTDrizzle Team
Created by Sebastian on 7/9/2023 in #help
Cannot drop index 'idx': needed in a foreign key constraint
This was the SQL code that was throwing the error: DROP INDEX user_id_idx ON user_profile;--> statement-breakpoint ALTER TABLE user_profile ADD PRIMARY KEY (user_id);--> statement-breakpoint ALTER TABLE user_profile DROP COLUMN id;--> statement-breakpoint Changing the order of the statements makes the script run successfully ALTER TABLE user_profile DROP COLUMN id;--> statement-breakpoint ALTER TABLE user_profile ADD PRIMARY KEY (user_id);--> statement-breakpoint DROP INDEX user_id_idx ON user_profile;--> statement-breakpoint
2 replies
TTCTheo's Typesafe Cult
Created by Debaucus on 6/16/2023 in #questions
With Planetscale (or others), what's the correct way to retroactively edit a prod database?
when adding new columns, if you want the column to be not null, you can use the default directive and on a later migration you can remove it if it annoys you with anything, though I wouldn't see the point.
5 replies
TTCTheo's Typesafe Cult
Created by .traevelliath on 6/22/2023 in #questions
Prisma 2-3 levels deep queries
Make sure your schema is correctly defined. You can either use self relations or a separate table to manage the friends. If the schema is correctly defined, you should be able to perform the nested includes to get friends of friends
17 replies
TTCTheo's Typesafe Cult
Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
sure, feel free to pm me
15 replies