PrismaP
Prisma3mo ago
4 replies
neca

Problem with generate and generate --sql

HI,

I have multiple problems with npx prisma generate .
I've updated to the newest version and tried to use typedSql .
1. When I generate prisma client, I get dozens of errors in my existing code. As I am importing PrismaClient from node_modules and not generated folded ( I want to keep it that way). After some digging I see that PrismaClient is generated as the type of any and everything breaks. After around 50 retries of running generate command, the PrismaClient was generated correctly...
2. I decided to rollback to previous version (6.13.0), but npx prisma generate is running with v6.19.0. Is there any cache or something?
3. What should I do in the pipeline when it comes to --sql? Should I commit generated folder or run --sql command in the pipeline? My workflow will spin-up postgres to execute int test. So when I use "build": "npx prisma generate && tsc -p . && tscp" the first error is dispalyed in the logs. If I try "build": "npx prisma generate && npx prisma generate --sql && tsc -p . && tscp" , I get the error saying that the database is not running on localhost..
image.png
Was this page helpful?