Closed larsivi closed 1 year ago
Hi, @larsivi
According to the error messages, it seems to be an unrelated problem with this generator. Have you installed the pothos prisma plugin?
After installation, please test that everything is working without including this generator in schema.prisma
If indeed the error is related to this generator, can you please share a minimal reproducible example?
Hmm, you are right. I must have made some error earlier - this does not work without the pothos generators either. Sorry for the disturbance. I had just read from a different prisma issue that this was supposed to have been fixed there, and I didn't test it properly.
For posterity, my initial mistake was that I had messed up the workspace setup, which was what caused the NPM stuff. However, after fixing that, the pothos plugins were still not found.
Looking at the @pothos examples, I noted that "generate": "prisma generate" was added to the scripts in package.json, and when I did that and ran "pnpm generate" rather than "pnpx prisma generate" it worked.
So in the end this is probably some inconsistency between pnpx and pnpm run, or perhaps out of scope of pnpx.
FWIW, changes to public-hoist-pattern wasn't necessary either.
I am trying to use this in a module a monorepo using pnpm.
When running "pnpx prisma generate", I first got:
Then I added prisma-pothos-generator-codegen to public-hoist-pattern in .npmrc (seems to generally be a thing for various plugins). When running generate now I get
So something here is trying to run npm which is pretty much a no-no inside a pnpm-enabled repo. Assuming it tries to do something like "npx prisma-pothos-types", it should probably rather run "pnpx prisma-pothos-types". I wouldn't mind looking at this, but am a bit baffled at where this happens (could it be via prisma generate?).
Note that the npm error is that it is reading the package.json which uses a pnpm specific feature.