-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Description
After starting with today's version (there is no version tag):
yarn dev
And running a posts query in the playground, I received the following error:
Server is running on http://localhost:4000
Serving playground at http://localhost:3000/playground
Error: Cannot use GraphQLSchema "[object Object]" 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.
Solved it by
- yarn clean cache
- npm -rf node_modules
- added in package.json the "resolutions" section
- yarn install
{
"name": "node-advanced",
"scripts": {
"start": "nodemon -e js,graphql -x node -r dotenv/config src/index.js",
"debug": "nodemon -e js,graphql -x node --inspect -r dotenv/config src/index.js",
"playground": "graphql playground",
"dev": "npm-run-all --parallel start playground"
},
"dependencies": {
"bcryptjs": "2.4.3",
"graphql-yoga": "1.3.2",
"jsonwebtoken": "8.1.1",
"prisma-binding": "1.5.12"
},
"devDependencies": {
"dotenv": "5.0.0",
"graphql-cli": "2.14.1",
"nodemon": "1.15.0",
"npm-run-all": "4.1.2",
"prisma": "1.2.4"
},
"resolutions": {
"graphql": "^0.13.0",
"**/graphql": "^0.13.0"
}
}
Or is there a better way resolving this error situation?
tarek-eg, pradel, iskanderbroere, wasd171, rodmansw and 13 more
Metadata
Metadata
Assignees
Labels
No labels