Prisma now wants me to have an `app` folder?

Hey guys, I have been using Prisma for a little while, but have taken a break and have just got back into my side project, and noticed that now Prisma is asking me to have a separate app folder? I am not sure I understand, I thought it would generate normally and then you import from @prisma/client? Why do we need to use a separate app folder now? thanks in advance.
3 Replies
Prisma AI Help
Skipping coffee for instant knowledge! Let's brew that AI answer now. No, Prisma does not require you to have an app folder specifically. What has changed recently is the recommended (and soon required) way to generate and import the Prisma Client. Previously, Prisma Client was generated by default into node_modules and you would import it like this:
import { PrismaClient } from '@prisma/client'
import { PrismaClient } from '@prisma/client'
However, starting with Prisma ORM 6.6.0 (and required in v7), you are encouraged to specify a custom output path for the generated client using the output field in your generator block. The docs and examples often use app/generated/prisma/client or src/generated/prisma/client as a common convention, but you can choose any folder that fits your project structure. For example:
generator client {
provider = "prisma-client-js"
output = "app/generated/prisma/client"
}
generator client {
provider = "prisma-client-js"
output = "app/generated/prisma/client"
}
You would then import PrismaClient from that path:
import { PrismaClient } from 'app/generated/prisma/client'
import { PrismaClient } from 'app/generated/prisma/client'
The reason for this change is to give you more control and flexibility, especially for modern JavaScript environments (like ESM, Bun, Deno, monorepos, etc.), and to avoid issues with generating code inside node_modules. The app folder is just a suggested location—feel free to use src, generated, or any other directory you prefer. The key is that you now need to import from wherever you generate the client, not necessarily from @prisma/client anymore. This is not about enforcing an app folder, but about making the output location explicit and flexible for your needs Generating Prisma Client prisma-client Early Access.
DeathlyNocturnal
DeathlyNocturnalOP3d ago
@Prisma AI Help Okay, so I have a framework, and that framework has a plugin for Prisma, the plugin simply initialises the prisma client within the framework, so it can be injected to any controller. If the path can be "defined" then how would this work? Because if the path is dynamic depending on the user, I have to use Reflect, to add metadata to the class so that it can be imported, but without a set place, it feels difficult to deal with? Off topic, but why does the bot not respond to a reply........... -_-
Nurul
Nurul17h ago
Hey, you should be able to continue the conversation with bot in #ask-ai

Did you find this page helpful?