Skip to content
New issue

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

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

Already on GitHub? # to your account

Multiple instances of "graphql" #556

Open
jnak opened this issue Apr 17, 2019 · 1 comment
Open

Multiple instances of "graphql" #556

jnak opened this issue Apr 17, 2019 · 1 comment

Comments

@jnak
Copy link

jnak commented Apr 17, 2019

On a fresh install, I get this error when running yarn dev:

yarn dev
yarn run v1.10.1
$ npm-run-all --parallel start playground
$ nodemon -e ts,graphql -x ts-node --no-cache -r dotenv/config src/index.ts
$ graphql playground
[nodemon] 1.18.11
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `ts-node --no-cache -r dotenv/config src/index.ts`
Serving playground at http://localhost:3000/playground
Server is running on http://localhost:4000
Error: Cannot use GraphQLSchema "[object GraphQLSchema]" 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/julien/code/graphql-prisma-typescript/node_modules/graphql/jsutils/instanceOf.js:37:13)
    at isSchema (/Users/julien/code/graphql-prisma-typescript/node_modules/graphql/type/schema.js:34:34)
    at assertSchema (/Users/julien/code/graphql-prisma-typescript/node_modules/graphql/type/schema.js:38:4)
    at validateSchema (/Users/julien/code/graphql-prisma-typescript/node_modules/graphql/type/validate.js:53:28)
    at assertValidSchema (/Users/julien/code/graphql-prisma-typescript/node_modules/graphql/type/validate.js:77:16)
    at Object.validate (/Users/julien/code/graphql-prisma-typescript/node_modules/graphql/validation/validate.js:55:35)
    at doRunQuery (/Users/julien/code/graphql-prisma-typescript/node_modules/apollo-server-core/src/runQuery.ts:181:30)
    at /Users/julien/code/graphql-prisma-typescript/node_modules/apollo-server-core/src/runQuery.ts:80:39
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm.

I suspect this is because renovate-bot automatically upgrades dependencies and there are no tests setup in this repo.

@jnak
Copy link
Author

jnak commented Apr 17, 2019

FYI I reverted to 2d4994c and it seems to work fine. I had to use npm install thought because yarn was failing:

error An unexpected error occurred: "https://registry.yarnpkg.com/flatmap-stream/-/flatmap-stream-0.1.2.tgz: Request failed \"404 Not Found\"".

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

No branches or pull requests

1 participant