Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'graphql/utilities/schemaPrinter #606

Closed
rotosonic opened this issue Apr 16, 2020 · 3 comments
Closed

Cannot find module 'graphql/utilities/schemaPrinter #606

rotosonic opened this issue Apr 16, 2020 · 3 comments
Labels
Community 👨‍👧 Something initiated by a community Duplicate 🔑 This issue or pull request already exists

Comments

@rotosonic
Copy link

build error:

nest build

node_modules/type-graphql/dist/utils/buildSchema.d.ts:2:47 - error TS2307: Cannot find module 'graphql/utilities/schemaPrinter'.

2 import { Options as PrintSchemaOptions } from "graphql/utilities/schemaPrinter";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/type-graphql/dist/utils/emitSchemaDefinitionFile.d.ts:2:47 - error TS2307:
Cannot find module 'graphql/utilities/schemaPrinter'.

2 import { Options as PrintSchemaOptions } from "graphql/utilities/schemaPrinter";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

package.json

{
"name": "nest-lambda",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write "src//*.ts" "test//.ts"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint "{src,apps,libs,test}/**/
.ts" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/core": "^7.0.0",
"@nestjs/graphql": "^7.2.4",
"@nestjs/mongoose": "^6.4.0",
"@nestjs/platform-express": "^7.0.0",
"apollo-server-express": "^2.12.0",
"aws-lambda": "^1.0.5",
"aws-sdk": "^2.656.0",
"aws-serverless-express": "^3.3.8",
"graphql": "^15.0.0",
"graphql-tools": "^5.0.0",
"mongoose": "^5.9.9",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.5.4",
"type-graphql": "^0.17.6"
},
"devDependencies": {
"@nestjs/cli": "^7.0.0",
"@nestjs/schematics": "^7.0.0",
"@nestjs/testing": "^7.0.0",
"@types/jest": "25.1.4",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"jest": "^25.1.0",
"prettier": "^1.19.1",
"supertest": "^4.0.2",
"ts-jest": "25.2.1",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.2",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}

@MichalLytek
Copy link
Owner

Please check your peer deps.
TypeGraphQL does not work with GraphQL 15 yet - see #594.

@MichalLytek MichalLytek added Community 👨‍👧 Something initiated by a community Duplicate 🔑 This issue or pull request already exists labels Apr 16, 2020
@arimus
Copy link

arimus commented Sep 28, 2020

Still getting this error message, even when pinned to 14.x. I tried with 14.1.1 and with latest 14.7.0, with the same result when using 1.0.0. Any suggestions?

node_modules/type-graphql/dist/utils/emitSchemaDefinitionFile.d.ts(2,54): error TS2307: Cannot find module 'graphql/utilities/printSchema'.

Here are the changes I made in trying to upgrade:

     "await-to-js": "^2.1.1",
     "aws-sdk": "^2.673.0",
     "bcryptjs": "^2.4.3",
+    "class-validator": "^0.12.2",
     "cls-rtracer": "^2.3.0",
     "del": "^5.1.0",
     "dependency-graph": "^0.9.0",
     "emitter-listener": "^1.1.2",
     "good-squeeze": "^5.1.0",
-    "graphql": "^14.6.0",
+    "graphql": "^14.7.0",
     "graphql-type-json": "^0.3.1",
     "hapi-auth-jwt2": "^10.1.0",
     "hapi-swagger": "^13.1.0",
@@ -86,7 +87,7 @@
     "stack-trace": "0.0.10",
     "stream-to-string": "^1.2.0",
     "subscriptions-transport-ws": "^0.9.16",
-    "type-graphql": "^0.17.6",
+    "type-graphql": "^1.0.0",
     "typeorm": "0.2.24",
     "typeorm-model-generator": "https:/arimus/typeorm-model-generator.git",
     "typeorm-naming-strategies": "^1.1.0",

@MichalLytek
Copy link
Owner

@arimus upgrade to v15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community 👨‍👧 Something initiated by a community Duplicate 🔑 This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants