im getting this error

how can i fix this i didnt understand what it says
No description
11 Replies
Neto
Neto6mo ago
did you run the migrations?
şiar_619
şiar_619OP6mo ago
no i was just following theos tutorial video when i run npm run dev i got this error
Neto
Neto6mo ago
GitHub
The table (not available) does not exist in the current database ...
Bug description I'm getting this error with a PlanetScale database Message: Error in Prisma Client request: {"type":"PrismaClientKnownRequestError","code":"P2...
şiar_619
şiar_619OP6mo ago
i dont have a database right now i have just started to learn t3. could it be the problem prisma:error Invalid prisma.post.findFirst() invocation: The table main.Post does not exist in the current database. ❌ tRPC failed on post.getLatest: Invalid prisma.post.findFirst() invocation: The table main.Post does not exist in the current database.
shivam
shivam6mo ago
i think it has something to do with table name, it doesn't exist oh, yes you have to setup a database and setup env keys
şiar_619
şiar_619OP6mo ago
alright ill try that thanks
shivam
shivam6mo ago
did it work ?
şiar_619
şiar_619OP6mo ago
i cannot connect a db to it i am using mysql i created an empty scheme to connect it but i am new too these stuff how can i do it? The table post does not exist in the current database. A query that was dehydrated as pending ended up rejecting. [[["post","getLatest"],{"type":"query"}]]: TRPCError: Invalid prisma.post.findFirst() invocation: The table post does not exist in the current database.; The error will be redacted in production builds ⨯ Internal error: Error: redacted at eval (./node_modules/@tanstack/query-core/build/modern/hydration.js:37:31) when i added post table to database it gave me this error The column es.Post.id does not exist in the current database. ❌ tRPC failed on post.getLatest: Invalid prisma.post.findFirst() invocation: The column es.Post.id does not exist in the current database. GET /api/trpc/post.getLatest?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%7D 200 in 512ms prisma:query SELECT es.Post.id, es.Post.name, es.Post.createdAt, es.Post.updatedAt FROM es.Post WHERE 1=1 ORDER BY es.Post.createdAt DESC LIMIT ? OFFSET ?
shivam
shivam6mo ago
i think there is a schema.ts when you create the project with t3 stack which db provider are you using ? if you're getting this it means there is no table in the database try following these steps: 1. get the env keys required from your db provider 2. put them in .env 3. run the db:push command if it succeds it means the tables that is pre-defined or you have defined in schema.ts has been created in the database 4. it might work
şiar_619
şiar_619OP6mo ago
this worked thanks so much
shivam
shivam6mo ago
lfg
Want results from more Discord servers?
Add your server