Console Spam: "CODE: PrismaClientOnContextInstanceOfStrategyFailed"
Hey guys, getting a constant spam of this error/warning:
Had it for a while and still can't figure out exactly what might cause it, the error message itself is going over my head a bit. I can understand it in a general sense, but not enough to know why it's popped up or what could be causing it. It specifically hits my console when a user is making a GQL query to our backend, which is using Nexus/Nexus-Prisma.
Any ideas? Can't find any mention of this warning code anywhere.
Prisma Version: 6.10.1
SOLUTION UPDATE:
This was actually a warning from nexus-prisma, which can be changed/turned off using the runtime settings:
7 Replies
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into
#ask-ai if you get antsy for a second opinion!This seems to be coming from graphql nexus: https://github.com/prisma/prisma/discussions/26879
Do you have multiple PrismaClient instances in your app?
Sorry for the delay over the weekend - yes and no. We run multiple instances over PM2, but each application instance draws from the same client, as below:
We've been using Prisma without issues like this for years, I believe this has only come up since we updated from 5.22.0 to 6.10.1 last week.
I am not aware of any changes from version 5 to 6 that could have triggered this error.
Maybe graphql-nexus team did some changes 🤔
From what I understand, graphql-nexus/prisma-nexus hasn't updated all year.
Is there a way to potentially just mute the log? It's not causing me any issues besides flooding my production console every time someone sends a gql query.
Looking deeper, the warning is coming directly from
nexus-prisma and not prisma itself. Will have to keep researching, thank you!
If anyone comes looking for this solution later, here is finally how I resolved it:
Thanks for taking the time to share the solution 🙌