Keystone 16.0.0 Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm
See original GitHub issueBug report
Describe the bug
I get the following error after bumping @keystonejs/keystone
to ^16.0.0
:
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 (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/node_modules/graphql/jsutils/instanceOf.js:29:13)
at Object.isSchema (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/node_modules/graphql/type/schema.js:42:34)
at new ApolloServerBase (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/node_modules/apollo-server-core/dist/ApolloServer.js:160:23)
at new ApolloServer (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/node_modules/apollo-server-express/dist/ApolloServer.js:60:9)
at Keystone.createApolloServer (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/lib/Keystone/index.js:453:20)
at Keystone.prepare (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/lib/Keystone/index.js:615:10)
at executeDefaultServer (/home/toye/Dev/js/vue/musicx/node_modules/@keystonejs/keystone/bin/utils.js:149:42)
my dependencies:
"dependencies": {
"@keystonejs/adapter-mongoose": "^9.0.7",
"@keystonejs/app-admin-ui": "^7.3.6",
"@keystonejs/app-graphql": "^6.1.2",
"@keystonejs/app-nuxt": "^5.1.6",
"@keystonejs/auth-password": "^5.1.14",
"@keystonejs/fields": "^17.1.3",
"@keystonejs/fields-cloudinary-image": "^1.0.6",
"@keystonejs/fields-markdown": "^5.2.9",
"@keystonejs/fields-wysiwyg-tinymce": "^5.3.10",
"@keystonejs/file-adapters": "^7.0.7",
"@keystonejs/keystone": "^16.0.0",
"@keystonejs/list-plugins": "^7.1.1",
"@nuxtjs/apollo": "^4.0.1-rc.3",
"cross-env": "^7.0.2",
"dotenv": "^8.2.0",
"express": "^4.17.1",
},
Deleting ./node_modules/@keystonejs/keystone/node_modules/graphql
allows the app to build and start 🤷♂️
System information
- OS: Windows / WSL2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Keystone 16.0.0 Error: Cannot use GraphQLSchema "[object ...
Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm. Ensure that there is only one instance of "graphql" ...
Read more >Error: Cannot use GraphQLSchema "[object ... - Stack Overflow
I get this error: Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm. Ensure that there is only one instance ......
Read more >How to fix the error: “Cannot use GraphQLSchema “[object ...
Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm. Ensure that there is only one instance of "graphql" ...
Read more >Hírek, események - RisingStack Engineering
The second turned out to be the missing keystone of the organizational shift. ... Object.hasOwn is a static alias for Object.prototype.hasOwnProperty.call :
Read more >Ben Awad on Twitter: "Love seeing "Cannot use ...
Love seeing "Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm." every time I upgrade the graphql package. ... as peerDependency. We ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in package.json
can fix this issue.
This issue is still relevant. I just started using keystone for the first time and immediately ran into this error