관리 메뉴

SW

[GraphQL] Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm. 본문

대학교/etc

[GraphQL] Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm.

SWKo 2020. 7. 22. 13:21

1. Error

  • yarn과 npm으로 graphql을 중복 설치하여 생긴 문제

 

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 (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\jsutils\instanceOf.js:29:13)
    at isSchema (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\type\schema.js:42:34)
    at assertSchema (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\type\schema.js:46:8)
    at validateSchema (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\type\validate.js:44:28)
    at assertValidSchema (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\type\validate.js:68:16)
    at Object.validate (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\graphql\validation\validate.js:51:35)
    at doRunQuery (C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\apollo-server-core\dist\runQuery.js:111:42)
    at C:\Users\KFL202007_2\ko3\myclothescoordinateapp\mobileapp\server\node_modules\apollo-server-core\dist\runQuery.js:21:56
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
 
 

2. Solution

  • yarn.lock 삭제
  • yarn add

 

'대학교 > etc' 카테고리의 다른 글

도커(Docker)  (0) 2020.07.30
MSA (Micro Service Architecture)  (0) 2020.07.30
[React Native] npm ERR! A complete log of this run can be found in:  (0) 2020.07.22
[JS] spread operator(...) : Unexpected token  (0) 2020.07.20
네이버 API  (0) 2020.04.06
Comments