-
Notifications
You must be signed in to change notification settings - Fork 860
Duplicate "graphql" #1928
Comments
@tfiwm Here was my issue downgrade your prisma to
This is in your project not globally. |
@tfiwm could you try using the global dependency for |
I am getting similar errors: Error: Cannot use GraphQLSchema "[object Object]" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
at instanceOf (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/jsutils/instanceOf.js:17:13)
at isSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/schema.js:48:35)
at validateSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:51:25)
at assertValidSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:76:16)
at Object.validate (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/validation/validate.js:61:35)
at doRunQuery (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:143:30)
at /Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:69:39
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7) Please let me know if you want a new issue for this. |
I was trying different setup options for prisma and see the same thing what ever I do (these are fresh installs). Adding this to "resolutions": {
"graphql": "^0.13.1"
} Update: I am using: $ prisma --version
prisma/1.2.4 (darwin-x64) node-v9.5.0 |
@lirbank your solution works for me! Thx ;) |
For anyone who is using Yarn, this is a known issue between them & Update:I can't find the issue. I'll try to look more later when I have a bit more time. Cheers |
@iamclaytonray Just a heads up before you close this issue - if you have yarn installed on your system and follow the steps here https://www.prismagraphql.com/docs/quickstart/ it happens every time (at least for me). You don't see it if you start fresh? |
I don't have access to close the issue but despite setting up Prisma a specific way, the issue is between Yarn and @lirbank - I did use those steps though, as well as going off of memory. I have noticed that it will work with Yarn sometimes, depending on the version of |
Yeah, seems the trouble was with yarn. @iamclaytonray . Your solution works for me.. |
Hey @tfiwm @maarteNNNN @peterschussheim @lirbank @iamclaytonray, thanks for chiming in. Could you please check if following these instructions solves the issue for you? Thanks! 🙌 |
As @lirbank pointed out, add the following to your "resolutions": {
"graphql": "0.13.1"
} Please let us know if someone still hits this problem. |
For anyone still running into this, upgrading |
And for anyone else fighting this one, I've found this error on port conflicts. If the server didn't properly shut down and still holds the port, restarting the server will throw the port conflict error but will also throw the multiple versions of GraphQL duplicate error, so you may never notice the port error at the very top of the terminal. To fix it (on a Mac), first find the offending process |
Quick tip to @LawJolla: Use https://github.com/sindresorhus/fkill-cli to make killing processes by port easier. 💯 |
|
Wow, I can't believe that the only solution was to use NPM instead of yarn. I tried EVERYTHING, but that was the only thing that helped. Oh well, luckily npm is much faster now. |
Is this considered to be solved? I cannot make it work in any of my applications ;( Only NPM works. Yarn is deaf. I have everything installed properly:
I have following in my package.json
Yet still no love ;( |
I am still getting this issue. package.json
npm script I've tried killing every process, uninstalling Yarn, installing everything with NPM. Nothing works. Frustrating... |
I was getting this error running |
@sscaff1 - try removing ranges & pinning exact deps. You should not actually need a Looks like my above comment helped everyone else out before so should work for you. What OS are you on and how are you running the server? Locally or docker? |
I'm having the same problem as her and I'm running Docker. I have tried absolutely everything |
This worked for me. |
What I can't figure out is why this started happening to me since I have not changed any of my dependencies at all. I made changes to my datamodel and that is all. Deleting the modules and reinstalling did not work and searching processes on my port returned nothing. Update: running prisma generate works, but I don't know if that's really a fix. Any leads on what's causing deploy to stop working but allowing generate to work? What's the difference, anyway? |
same |
Downgrading to:
solved this issue for me |
@Wgil I'm not sure I consider downgrading to pre-prisma-client a solution.. We need to be able to use npm and the latest stable release of prisma imo. Yarn shouldn't be necessary as it is not always up to date with prisma, at least it wasn't the last time I used it, when I was trying to move from 1.17 to 1.18, at which point I had to delete yarn to let npm be prioritized globally. If yarn is required to use prisma without errors, would it be reasonable to state so in the docs? Edit: perhaps it's more a problem with graphql/npm? I'm not sure but it seems more or less isolated to prisma deploy. I had to restart my whole project as I wasn't able to isolate the problem in effort to ensure sustainability down the road. |
@jackgray you're right. By the way, It also worked on npm... |
I'm getting this error with 1.34. 1.33 worked fine (npm 6.4.1) |
i solved this by doing |
Combining with all the methods specified above. 1.) Delete your node_modules and your package-lock.json
2.) On your
3.) Install all dependencies Current Global versions Node version: v14.14.0
Prisma version: v1.34.10 |
We had this problem inside graphql-yoga too but it was fixed. Now it looks like that we have it in prisma too
Bug Report
Current behavior
Reproduction
Prisma project with following package.json
Expected behavior?
Server is working ;)
The text was updated successfully, but these errors were encountered: