P
Prisma3mo ago
asciant

How do you deploy the new generated client?

I have tried using the new generator, as advised to do so by the CLI.
generator client {
provider = "prisma-client" // Required
output = "./generated"
}
generator client {
provider = "prisma-client" // Required
output = "./generated"
}
I then mapped the alias to my tsconfig.json:
"paths": {
"~/*": ["./app/*"],
"@/*": ["./prisma/generated/*"]
},
"paths": {
"~/*": ["./app/*"],
"@/*": ["./prisma/generated/*"]
},
I am able to import the client and use it in my application:
import { Prisma, type User, type Role } from "@/client";
import { Prisma, type User, type Role } from "@/client";
However, when I try to deploy my application to Fly.io. I endlessly recieve the following when trying to run pnpm run build:
[vite]: Rollup failed to resolve import "@/client" from "/myapp/app/models/user.server.ts".
[vite]: Rollup failed to resolve import "@/client" from "/myapp/app/models/user.server.ts".
It seems that, no matter what I do, the generated client alias is not able to be used by my application. Is there some secret sauce that I am missing here?
2 Replies
Prisma AI Help
Prisma AI Help3mo ago
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
asciant
asciantOP3mo ago
Nevermind, I reverted back to the prisma-client-js without the output generated. I'll probably wait until v7 comes out and others blaze the trail. Worth noting, it may be beneficial to update some of the examples. Try deploying to environments like Fly or Render and then document the kinks for the community. https://github.com/prisma/prisma-examples/blob/latest/deployment-platforms/render/prisma/schema.prisma
GitHub
prisma-examples/deployment-platforms/render/prisma/schema.prisma at...
🚀 Ready-to-run Prisma example projects. Contribute to prisma/prisma-examples development by creating an account on GitHub.

Did you find this page helpful?