Sebastian
Explore posts from serversTTCTheo'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
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.
13 replies
TTCTheo's Typesafe Cult
•Created by Sebastian on 1/4/2024 in #questions
Prisma turborepo deployment not initialized error
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
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
17 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
TTCTheo's Typesafe Cult
•Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
what seems to not work
15 replies
TTCTheo's Typesafe Cult
•Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
you can also reffer to the official documentation for more details:
https://trpc.io/docs/server/server-side-calls
15 replies
TTCTheo's Typesafe Cult
•Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
15 replies
TTCTheo's Typesafe Cult
•Created by VIIKKK on 6/1/2023 in #questions
Question about next auth.
The thing you explicitly outlined in the pseudocode would not work. You imported a specific router and tried to access a procedure on it. When tRPC initializes does a lot of things, constructs the context and other configurations ( especially if you have built it using create-t3-app ) which it then uses in the other underlying routers which you then compose in the appRouter.
What you want to do is achievable, but you will have to import the appRouter and create a new instance by calling
.createCaller({})
on it. It will give you a new tRPC router which you can use to authorize the user.
Your code might look something like this:15 replies
TTCTheo's Typesafe Cult
•Created by Sebastian on 5/27/2023 in #questions
Neatly extract tRPC middleware to make it reusable
up
3 replies
TTCTheo's Typesafe Cult
•Created by bassamanator on 5/15/2023 in #questions
TRCPClientError when creating an entry with blank `updatedAt`
You can use the @updatedAt directive for letting prisma correctly handling it
4 replies
TTCTheo's Typesafe Cult
•Created by Sebastian on 5/12/2023 in #questions
Next-Auth in server rendered components aka appDir pages
I was mainly wondering how can we get the current user in a request. I digged very little in the getServerSession from next-auth/next and saw that for server components, they take the cookies from the head using next/head and then are able to authenticate the user and return a valid session. Just if anybody was wondering that. You just need to pass the authOptions object to the getServerSession
4 replies
TTCTheo's Typesafe Cult
•Created by Sebastian on 2/10/2023 in #questions
Deployment error on vercel
it worked, thanks 👌🏻
9 replies