parse-server
parse-server copied to clipboard
Error: Cannot find module 'graphql'
New Issue Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
- [ ] I can reproduce the issue with the latest version of Parse Server.
Issue Description
I am building a custom docker image regularly from the alpha branch. I only depend on parse-server, push-adapter, and s3-adapter. Since today my developer build started failing with the following stack.
Error: Cannot find module 'graphql'
Require stack:
- /home/node/XXX/node_modules/graphql-upload/public/GraphQLUpload.js
- /home/node/XXX/node_modules/graphql-upload/public/index.js
- /home/node/XXX/node_modules/parse-server/lib/GraphQL/ParseGraphQLServer.js
- /home/node/XXX/node_modules/parse-server/lib/ParseServer.js
- /home/node/XXX/node_modules/parse-server/lib/index.js
- /home/node/XXX/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/node/XXX/node_modules/graphql-upload/public/GraphQLUpload.js:3:45)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/node/XXX/node_modules/graphql-upload/public/GraphQLUpload.js',
'/home/node/XXX/node_modules/graphql-upload/public/index.js',
'/home/node/XXX/node_modules/parse-server/lib/GraphQL/ParseGraphQLServer.js',
'/home/node/XXX/node_modules/parse-server/lib/ParseServer.js',
'/home/node/XXX/node_modules/parse-server/lib/index.js',
'/home/node/XXX/index.js'
]
}
Steps to reproduce
This is my package.json
{
"name": "xxx",
"version": "2.8.5",
"description": "XXX",
"main": "index.js",
"dependencies": {
"@parse/push-adapter": "^4.1.0",
"@parse/s3-files-adapter": "^1.6.1",
"axios": "^0.24.0",
"express-prometheus-middleware": "^0.8.5",
"mailgun.js": "^3.7.2",
"parse-server": "git+https://github.com/parse-community/parse-server.git#alpha",
"parse-server-api-mail-adapter": "^2.1.0",
},
"scripts": {
"start": "node index.js"
},
}
Server
- Parse Server version:
alpha - Operating system:
node:12 docker image
Thanks for opening this issue!
- ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.
The following dependencies seem to have resolved the issue for now, but since I do not use graphql or apollo, I am not sure if these will be required from 5.0 and why should I care. I only depend on parse-server and assume missing graphql modules will not lead to crash on startup.
Thoughts?
"graphql": "15.7.0",
"@apollo/client": "^3.2.9",
I did copy the graphql dependency from the parse-server itself. And added the @apollo/client since npm install did produce the following warning:
npm WARN @graphql-tools/[email protected] requires a peer of @apollo/client@~3.2.5 || ~3.3.0 || ~3.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @apollo/client@^3.0.0 but none is installed. You must install peer dependencies yourself.
Can you please be more specific with which alpha version the issue occurs and indicate that in the template?
You try with earlier alpha versions to see which commit started to cause the issue.
Generally, it may be time to give a thought to making GraphQL an external adapter for Parse Server. It seems there are way too many GraphQL related issues popping up, and I agree with you that a deployment that doesn't use GraphQL shouldn't have to worry about that.
@mman Is this still an issue?