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

Graphql versions #605

Closed
H1net opened this issue Jan 9, 2018 · 7 comments
Closed

Graphql versions #605

H1net opened this issue Jan 9, 2018 · 7 comments

Comments

@H1net
Copy link
Contributor

H1net commented Jan 9, 2018

The yarn.lock file has two graphql versions in it. The latest dependencies are causing my production build web client to fail on deployment to heroku with a console logged error regarding having two graphql versions installed.

Uncaught Error: Cannot use e "__Schema" 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 r (vendor.84d87188f15089ca936a.js:51)
    at p (vendor.84d87188f15089ca936a.js:51)
    at f (vendor.84d87188f15089ca936a.js:51)
    at V (vendor.84d87188f15089ca936a.js:51)
    at W (vendor.84d87188f15089ca936a.js:51)
    at new l (vendor.84d87188f15089ca936a.js:51)
    at l (vendor.84d87188f15089ca936a.js:51)
    at Object.<anonymous> (vendor.84d87188f15089ca936a.js:51)
    at t (vendor.84d87188f15089ca936a.js:1)
    at Object.<anonymous> (index.84d87188f15089ca936a.js:1)

I also note that the latest graphql caused errors in some of my stubs for modules I'm working on which did not yet have Mutations/Subscriptions in the server schema.graphql. The empty stubs had to be removed to solve the problem as they caused type definition problems.

@larixer
Copy link
Member

larixer commented Jan 9, 2018

@H1net Where does yarn.lock has two graphql versions in it?

@larixer
Copy link
Member

larixer commented Jan 9, 2018

@H1net As for your second statement about the empty stubs. Yes, this is true, I have noticed this and removed empty stubs from master in the last commit:
c92cfae

@larixer
Copy link
Member

larixer commented Jan 9, 2018

@H1net To have one version of GraphQL used everywhere we use resolutions, check here:

"resolutions": {
"graphql": "^0.12.3"
},

@H1net
Copy link
Contributor Author

H1net commented Jan 9, 2018

Talk about lightning quick response their @Vlasenko!
I assumed it was this:

"@types/graphql@0.10.2":
  version "0.10.2"
  resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-0.10.2.tgz#d7c79acbaa17453b6681c80c34b38fcb10c4c08c"

"@types/graphql@^0.9.0":
  version "0.9.4"
  resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-0.9.4.tgz#cdeb6bcbef9b6c584374b81aa7f48ecf3da404fa"

@larixer
Copy link
Member

larixer commented Jan 9, 2018

@H1net @types/graphql is not a js code, it is rather TypeScript declarations and those are not used during runtime, they are transitive deps used by other packages that need TypeScript types during build time.

@larixer
Copy link
Member

larixer commented Jan 9, 2018

Looks like the cause of this issue is described here:
graphql/graphql-js#1182

@larixer
Copy link
Member

larixer commented Jan 9, 2018

@H1net I'm going to rollback to graphql@0.11.x in the kit master for time being, until this fix will be released:
graphql/graphql-js#1174

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