Cyrus
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
Thanks for the response. I will work on a repro when in the next few days. Just have a deadline this week
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
What's the ETA here? I've been waiting 5 months for this issue already...
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
thanks
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
What did the engineering team say?
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
ty
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
Needless to say, I dont want to maintain that code so I still need a solution where the withAccelerate method gets generated into the custom output directory rather than importing it from the node_modules thing.
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
I ended up reverse-engineering the generated code in
node_modules/@prisma/extension-accelerate
and creating ts files from that, which I locally maintain. I removed node-fetch as I am running nextjs so fetch is in global namespace. I then went and imported the prisma client directly from my generated output rather than node_modules and it seems to be working.35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
any update?
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
just to be 100% clear, there's no building issue until the very last commit that changes the custom output directory
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
I am running into a different issue here with typings, but after you able to fix that you should run into the same issue.
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
I am pretty sure I already pointed out the issue, but sure let me do that.
I'll do these 3 steps:
- bootstrap a t3 app with pnpm https://create.t3.gg
- add withAccelerate to prisma https://www.npmjs.com/package/@prisma/extension-accelerate
- switch to a custom prisma output directory https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client#using-a-custom-output-path
Will let you know when its done
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
Thanks, standing by
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
This is how the @casl/prisma guys fixed the same issue: https://github.com/stalniy/casl/issues/621
Maybe accelerate can also use a generator?
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
This issue is related: https://github.com/prisma/prisma/issues/23319
The reason we need a custom directory in the first place is because of nx caching not working with pnpm symlinks (at least thats what it seems like)
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
but the error is obscure. The issue is that it cant find the package that is referenced
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
@RaphaelEtim @Jan (Prisma) any news?
35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
its looking at
@prisma/client
which would obviously mean /node_modules/@prisma/client
which does not exist as we got a default directory35 replies
PPrisma
•Created by Cyrus on 4/23/2024 in #help-and-questions
prisma accelerate + custom directory
look at the part where it says
import("@prisma/client/scripts/default-index.js")
in line 235 replies