Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to resolve "Duplicate graphql modules" issue as part of onboarding #41

Open
JofArnold opened this issue Mar 22, 2018 · 1 comment

Comments

@JofArnold
Copy link
Contributor

It's in the console but would help to set expectations.

@benjie
Copy link
Member

benjie commented Mar 22, 2018

See also: graphql/graphql-js#594

Detecting:

$ find node_modules -name graphql
node_modules/graphql

The above should only return one result. If there are other versions (in submodules) then they need to be "removed" so that only one version exists.

Resolving

Resolving with yarn: https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

Resolving with npm: ???

Resolving with webpack:

  resolve: {
    alias: {
      graphql:  path.resolve('./node_modules/graphql'),
      react:    path.resolve('./node_modules/react')                // Same issue.
    }
  }

From the horse's mouth

Quote from Lee Byron, creator of GraphQL:

graphql-js is not designed to support using functionality between different installations of itself. The instanceof is only one example where this failure occurs - but there are others as well, especially if there would ever be inadvertent differences in released versions.

If you use packages with sub-packages, ensure they support ranges of versions for graphql so that npm or yarn can find a single version to install at the top level which works for all dependents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants