output in schema

the output = "app/generated/prisma/client" seems to be very wrongly placed in the project structure whenever I simply run the following command of pnpm dlx prisma generate and I have actually no clue to why it's doing this. Seems to me like this is a bit of an issue. Could someone please help me out here a little bit to furthermore understand exactly what's going on? I was used to just simply have this structure prior to v7
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
No description
12 Replies
Prisma AI Help
Prisma AI Help•5mo ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
akinkunmi
akinkunmi•5mo ago
I have the same issue.
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
I fixed it but I am not currently at home to explain it for you šŸ˜‚
akinkunmi
akinkunmi•5mo ago
When can I check back? I've been stuck for over 12 hours on this.
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
About an hour or two?
akinkunmi
akinkunmi•5mo ago
Alright, thank you. Hey, @Jacob | idohtml.
Nurul
Nurul•5mo ago
Hey did you try passing a relative path like "./app/generated"?
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
Sorry I completely forgot to reply and I didn't even get a notice on this. So what I did was I removed the output = completely and what happens then you run the npx prisma generate cli is that when you generate your files in your node_modules you will find a prisma file with all the prisma needed code but if you want to have a specific output you can always set that to output = "../generated/prisma/client" and that will end up next to your app router or in the root of the project. You could also change this
generator client {
provider = "prisma-client-js"
}
generator client {
provider = "prisma-client-js"
}
to this
generator client {
provider = "prisma-client"
}
generator client {
provider = "prisma-client"
}
and that will give you a TS version from my understanding of the prisma client files.
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
Here is a video from the Prisma YouTube channel that explains it very well. https://www.youtube.com/watch?v=HKM4uTXS_Uw
Prisma
YouTube
NEW Prisma 6.6 - ESM Support, Migrations for D1, and More!
Prisma 6.6 is a huge release and is full of some great new features and long awaited improvements. This release brings support for ESM, the ability to use migratons with Cloudflare D1 and Turso, and some great new AI capabilities to improve your workflow. šŸ“£ Release notes 6.6: https://github.com/prisma/prisma/releases/tag/6.6.0 Prisma + Cloud...
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
However you need to keep in mind that when you use the old way (removing the output) you are using an older way of doing things and in your console you will get this warning from prisma meaning it's highly recommended to have an output or setting up an output
Prisma schema loaded from prisma/schema.prisma
Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
Prisma schema loaded from prisma/schema.prisma
Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
Maybe you could verify my statement here? Tell me if I am correct or not?
Nurul
Nurul•5mo ago
prisma-client is the new generator which supports ESM modules, which prisma-client-js does not. We have also officially started recommending specifying an output path. It is mandatory in the new prisma-client generator but is optional in the old generator prisma-client-js Let me know in case you still face any issues
Jacob | idohtml
Jacob | idohtmlOP•5mo ago
So far I have not faced any issues but I am not changing anything yet. I am looking into just using the output path in the future before launching my project.

Did you find this page helpful?