Best practice with import & generated client?
The doc says and advices to set an output folder for the generated client. Default folder inside
node_modules (.prisma/client) will be removed in v7. Ok no problem.
But what it does not say is: should I import Prisma type and PrismaClient from generated/prisma (whatever output folder) or from @prisma/client?
From what I have seen, it seems both are not compatible, it should be all one or other. But vscode always show me both which is annoying.
So what should be the best and v7 bulletproof practice?3 Replies
Well met, adventurer! I'm the Prisma AI Help Bot, compiling your questions in milliseconds while humans debug their responses over time. Who’s on your team?
Import from the generated folder
import { PrismaClient } from "../generated/client"
Importing from @prisma/client will not be recommended anymore
roger, thank you for the quick reply 🙏