`prisma-client` generator in compiled workspace package
Running into this error:
I know you can get rid of th error by setting declaration to false, but that is not an option for me. What is the best way to go about this?
11 Replies
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the
#ask-ai channel awaits if you're curious!Any ideas about this?
Can you share your setup so that I can try to reproduce and find a solution?
A minimal reproduction will be helpful.
Yes, let me get a repro set up
https://github.com/dbrxnds/prisma-internal-package-repro
Here you go. If you clone it and then run
pnpn dev you will see the issue occur in the nested-package/index.ts file.GitHub
GitHub - dbrxnds/prisma-internal-package-repro
Contribute to dbrxnds/prisma-internal-package-repro development by creating an account on GitHub.
Any idea? @Nurul
I tried to do this as well. I ended up using package.json imports to use it:
For the actual Prisma pkg I generated the ouptut into the apps folder, and used
npm pkg set name=@my-pkg-name/prisma-client to change the package.json name fieldIm not sure I follow. Do you add this to the package that consumes the Prisma package where the error occures?
To the package that consumes it.
It acts like a normal import doing it like that and Typescript is happy
Interesting, will give that a shot. Thanks! Kind of breaks the workspace system though I imagine
It does a little, but it was the best option I could find. My particular issue was I have a
.$extends and the typescript was being changed from a generic to explicit definitions, which broke the logic for some reason. So I found switching to this method a way to get round that