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

developing GQL libraries with npm link fails on startup #477

Closed
capaj opened this issue Jun 28, 2018 · 1 comment
Closed

developing GQL libraries with npm link fails on startup #477

capaj opened this issue Jun 28, 2018 · 1 comment

Comments

@capaj
Copy link

capaj commented Jun 28, 2018

I get this:

Error: Cannot use GraphQLScalarType "DateTime" 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 (/home/capaj/git_projects/graphql-repos/typegql/node_modules/graphql/jsutils/instanceOf.js:15:13)
    at isScalarType (/home/capaj/git_projects/graphql-repos/typegql/node_modules/graphql/type/definition.js:98:35)
    at Object.isType (/home/capaj/git_projects/graphql-repos/typegql/node_modules/graphql/type/definition.js:84:10)
    at resolveType (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:242:17)
    at resolveTypeOrThrow (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:741:24)
    at resolveRegisteredOrInferedType (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:769:16)
    at compileFieldConfig$$1 (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:802:24)
    at /home/capaj/git_projects/graphql-repos/typegql/lib/index.js:828:39
    at Array.forEach (<anonymous>)
    at getAllFields (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:823:25)
    at /home/capaj/git_projects/graphql-repos/typegql/lib/index.js:836:39
    at Array.forEach (<anonymous>)
    at compileAllFields$$1 (/home/capaj/git_projects/graphql-repos/typegql/lib/index.js:835:23)
    at /home/capaj/git_projects/graphql-repos/typegql/lib/index.js:867:16
    at /home/capaj/git_projects/graphql-repos/typegql/lib/index.js:139:22
    at resolveThunk (/home/capaj/git_projects/graphql-repos/typegql/node_modules/graphql/type/definition.js:370:40)
[ERROR] 02:08:55 Error: Cannot use GraphQLScalarType "DateTime" 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.

even though I am using the same version of the graphql package in both repos.
Would be nice if npm link worked with graphql as it works for any other node module.

@IvanGoncharov
Copy link
Member

@capaj Thanks for reporting an issue.
But this repo is for GraphQL specification, issues with graphql-js should be reported here: https://github.com/graphql/graphql-js

even though I am using the same version of the graphql package in both repos.

Yes, but you use different instances of same classes, constants, etc.

Would be nice if npm link worked with graphql as it works for any other node module.

It's already discussed here: graphql/graphql-js#1358
If you have an idea how to fix this issue PRs are welcome.

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