question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQL version issue on fresh install

See original GitHub issue

Just cloned the repo and install everything using yarn run setup as according to the README.md, and configured my database on my .env file. So far so good.

When I run yarn start serve, everything works just fine, but if I try to get into the /graphql URL to start doing some GraphQL queries, I get the following error:

{ "errors": [ { "code": "500", "message": "Cannot use GraphQLSchema \"[object GraphQLSchema]\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results." } ] }

Seems like a conflict between different dependencies requiring different versions of the GraphQL package. Also got this error after re-installing again on the same project with yarn install:

warning " > express-graphql@0.6.12" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".

Currently I’m using yarn@1.15.2 and node@10.15.3, btw.

Any info regarding this issue? Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
humbertowoodycommented, May 17, 2019

Can you add the specific versions of packages you added to make it work? I am having issues while trying to use GraphQL too! It sends the error you mentioned, but can’t find duplicate versions of GraphQL in my node_modules folder. As you said, I first solved the event-stream and flatmap-stream by deleting yarn.lock and doing a fresh yarn install, however this didn’t solved the GraphQL issue and it’s really bugging my mind. Thanks in advance!

0reactions
autumnfjeldcommented, Oct 10, 2019

Versions in the package.json should be locked down to a specific version. I ran into the GraphQL version conflict described above and also am seeing version issues with websockets, which is a dependency of event-dispatcher.

And, ideally all packages should be upgraded to modern versions.

Lovely framework!!! I’ve just spent too much time with npm version conflicts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Ensure that there are not multiple versions of GraphQL ...
All libraries should install graphql-js as a peer dependency so that a separate version is not installed. If this is not the case...
Read more >
Using a different version of graphql-tools
If you want to use a newer version, you can do so with the following steps: Install graphql-tools separately in your project. Update...
Read more >
graphql - npm
Latest version: 16.6.0, last published: 4 months ago. Start using graphql in your project by running `npm i graphql`.
Read more >
Getting Started With GraphQL.js
To create a new project and install GraphQL.js in your current directory: npm init. npm install graphql --save. Writing Code#. To handle GraphQL...
Read more >
GraphQL Tools – The Guild
Open Source developers with experience of working with the largest companies and applications. GraphQL consulting, workshops and trainings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found