nexus-plugin-prisma: ERROR: When nexus-plugin-prisma is used as a Nexus Schema plugin, @nexus/schema must be installed as a dependency. Please run `npm install @nexus/schema`.
Hi all,
I’ve been trying to move the prisma graphql-auth example to work with serverless functions. While I thought this was going to be easy I’m now stuck on a bug that I cannot make sense of.
The only changes to the repository are to src/server.ts to use GraphQLServerLambda rather than GraphQLServer as well as installing netlify-lambda to test my deployments.
Unfortunately that’s exactly where it goes wrong. As soon as I start my local lambda server and go to the endpoint, my API crashes with the error:
ERROR: When nexus-plugin-prisma is used as a Nexus Schema plugin, @nexus/schema must be installed as a dependency. Please run `npm install @nexus/schema`.
@nexus/schema as you can see from package.json is already installed as a dependency, so I’m kind of lost.
I created a repository that reproduces the issue, you can find it here.
Steps to reproduce:
npm installnpm run buildnpm run start:lambda- Visit http://localhost:9000/.netlify/functions/server
- Check your console and the error should be there
I’m fairly new with graphql so I this may be caused by me misunderstanding something, either way any help would be greatly appreciated as I’m completely stuck at the moment.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 30 (8 by maintainers)
This is still not fixed unless I’m missing something. I updated the reproduction git. To reproduce:
npm installnpm run buildnpm run build:lambdanpm run start:lambdaUpgrade to the latest Nexus Prisma plugin. This issue stems from older versions when there was Nexus Framework.
Any news on this issue, currently being affected by it as well. I’m trying out the different fixes mentioned in this thread and will update on what works/doesn’t work. We’re using serverless as well.
Having the same issue over here. In my case I’m trying to deploy Nexus Schema + Apollo Server as an AWS Lambda with the Serverless framework.
I bundle everything up with
ncc, then ship the output of that to AWS, but when invoking the Lambda I get the same issue as you @creativiii -@nexus/schema must be installed as a dependency.Really strange because I can guarantee you
@nexus/schemais installed haha, and running my Serverless function offline works fine too 🤷