graphql-nexus/nexus-prisma

support for prisma ^4.0.0

tmokmss opened this issue · 12 comments

Hi! Is there any plan to support Prisma v4? Currently we get the below error on npm install:

npm i  nexus-prisma
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: xxxx@0.0.0
npm ERR! Found: @prisma/client@4.4.0
npm ERR! node_modules/@prisma/client
npm ERR!   @prisma/client@"^4.3.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @prisma/client@"^3.5" from nexus-prisma@0.35.0
npm ERR! node_modules/nexus-prisma
npm ERR!   nexus-prisma@"*" from the root project
npm ERR! 

I installed with Prisma@4 using --legacy-peer-deps and haven't run into issues. I suspect if the package.json was updated to allow this, it would mostly work fine.

@rostislav-simonik can we just remove the peer dependency in the meantime? Some App hosting providers automatically install the dependencies without allowing you to add the --legacy-peer-deps flag

@ewodev I'm going to cut the release in two/three weeks. I don't have access to the publish token directly, so I'll stabilize the main branch and I'll cut it from there.

Does this ticket need renaming to "Support for prisma ^5.0.0"? :)

prisma 5.0.0 removed rejectOnNotFound. No way of using nexus-prisma with 5.0.0 then. It's a small fix.

So what is the solution here? Bump prisma back to 3.x.x ?
Does not work on 4.13.0.

Upgrade nexus-prisma to 2.0.1

I have it on 2.0.1.
I tried various version combinations, in all of them the same issue - socket hang up and missing peer dependency @prisma/client, even though it is installed.

@valajczech can you please create a minimalistic repo that replicates your case? That would give us more context to provide you support.

But nexus-prisma@2.x is only for prisma@5.x.x, so you would need to go back to nexus-prism@1.x, I don't recall which nexus-prisma@1.x is needed for 4.13.0

if, for some reason, you would like to stick with prisma@4.xthen go with prisma@4.16.2 + nexus-prisma@1.0.18

but your issue can originate from a different root cause, that's why better to provide a replicable repo if those versions won't help.

Thank you for your time, @rostislav-simonik.
I will try to create the repo asap and will let you know.

Of course I understand that, but I suspect the issue comes from nexus-prisma, since prior installing and using the plugin, everything ran ok.

Thank you.