Clean installation cannot execute due to incompatible graphql
Expected behaviour
I am installing fresh, and I would expect to be able to access http://localhost:4000/login/
or http://localhost:4000/
or any other suburl. We're hoping to deploy this system for internal paper review for a large scientific collaboration.
Current behaviour
I'm on the current HEAD, beb68f18, and I've fully cleaned all docker images and yarn/node modules. Starting from a completely fresh install, with a customized .env
with my own ORCID sandbox API etc, I execute yarn install
. Once this has completed, I execute docker-compose up
. The system starts, but after a while I notice this listed as part of the output:
server_1 | /home/node/app/node_modules/graphql-shield/node_modules/graphql/jsutils/instanceOf.js:29
server_1 | throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results."));
server_1 | ^
server_1 |
server_1 | Error: Cannot use GraphQLObjectType "Query" from another module or realm.
server_1 |
server_1 | Ensure that there is only one instance of "graphql" in the node_modules
server_1 | directory. If different versions of "graphql" are the dependencies of other
server_1 | relied on modules, use "resolutions" to ensure only one version is installed.
server_1 |
server_1 | https://yarnpkg.com/en/docs/selective-version-resolutions
server_1 |
server_1 | Duplicate "graphql" modules cannot be used at the same time since different
server_1 | versions may have different capabilities and behavior. The data from one
server_1 | version used in the function from another could produce confusing and
server_1 | spurious results.
server_1 | at instanceOf (/home/node/app/node_modules/graphql-shield/node_modules/graphql/jsutils/instanceOf.js:29:13)
server_1 | at isObjectType (/home/node/app/node_modules/graphql-shield/node_modules/graphql/type/definition.js:122:34)
server_1 | at /home/node/app/node_modules/graphql-shield/cjs/generator.js:181:44
server_1 | at Array.reduce (<anonymous>)
server_1 | at generateMiddlewareFromSchemaAndRuleTree (/home/node/app/node_modules/graphql-shield/cjs/generator.js:179:14)
server_1 | at MiddlewareGenerator.generator (/home/node/app/node_modules/graphql-shield/cjs/generator.js:203:24)
server_1 | at MiddlewareGenerator.generate (/home/node/app/node_modules/graphql-middleware/dist/generator.js:9:21)
server_1 | at /home/node/app/node_modules/graphql-middleware/dist/middleware.js:46:31
server_1 | at Array.map (<anonymous>)
server_1 | at applyMiddlewareWithOptions (/home/node/app/node_modules/graphql-middleware/dist/middleware.js:44:47)
server_1 | at applyMiddleware (/home/node/app/node_modules/graphql-middleware/dist/middleware.js:79:12)
server_1 | at Object.<anonymous> (/home/node/app/node_modules/@coko/server/src/graphqlSchema.js:103:30)
server_1 | at Module._compile (node:internal/modules/cjs/loader:1165:14)
server_1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
server_1 | at Module.load (node:internal/modules/cjs/loader:1043:32)
server_1 | at Function.Module._load (node:internal/modules/cjs/loader:878:12)
db_1 | 2023-05-15 13:57:18.122 UTC [62] LOG: could not receive data from client: Connection reset by peer
server_1 | [nodemon] app crashed - waiting for file changes before starting...
All attempts to access any URLs result in Error
pages, with simple "Cannot GET" text contents. There are additional warnings later from client_1
about failing to compile, but they seem non-fatal. For instance:
client_1 | ERROR in ../node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js 48:9
client_1 | Module parse failed: Unexpected token (48:9)
client_1 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#l
oaders
client_1 | | * They should probably be removed eventually.
client_1 | | */
client_1 | > export * as ElementType from "domelementtype";
client_1 | | import { getFeed } from "domutils";
client_1 | | export { getFeed } from "domutils";
client_1 | @ ../node_modules/cheerio/lib/esm/index.js 11:0-68 13:6-26
client_1 | @ ./components/component-submit/src/upload.js
client_1 | @ ./components/component-submit/src/components/UploadManuscript.js
client_1 | @ ./components/component-submit/src/components/NewSubmissionPage.js
client_1 | @ ./components/AdminPage.js
client_1 | @ ./routes.js
client_1 | @ ./app.js
client_1 | @ multi react-hot-loader/patch ./app
client_1 |
Steps to reproduce
I have executed this a few times and gotten the same results, when starting from a clean (no docker images or built containers) slate, and with clean repositories.
Environment
I'm using node 16.19.0
and yarn 3.5.1
.
Possible solution
I want to note that I am aware it's entirely possible I have done something wrong! I did my best to follow the instructions, but perhaps I have utilized something incorrectly. If I can provide any additional information I am happy to do so. Thank you!