What worked for me was deleting .build and node_modules folders first, then running npx prisma generate
.build
node_modules
npx prisma generate