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

GraphQL related build failures after migrating @nestjs/graphql package to v8 #7533

Closed
DaniSchenk opened this issue Jul 12, 2021 · 1 comment
Labels
needs triage This issue has not been looked into type: bug 😭

Comments

@DaniSchenk
Copy link

Regression

Checked migration docs v7 to v8 and GraphQL related module or type errors are not mentioned.

Potential Commit/PR that introduced the regression**

don't know

Describe the regression

I tried upgrading @nestjs/graphql to v8 and failed. I used the following code to reproduce the issue. Rolling back to @nestjs/graphql@7 solved my issues.

Input Code

Reproduction:

npm i -g @nestjs/cli@8
nest new project-name -> choose `npm`
cd project-name
npm run build

No failures so far. Now I followed the GraphQL Quickstart Tutorial

npm i @nestjs/graphql graphql-tools graphql apollo-server-express
nest g res example -> choose `GraphQL (code first)`
npm run build

I'm receiving the following errors:

> nest build

node_modules/@nestjs/graphql/dist/graphql-ast.explorer.d.ts:2:157 - error TS2307: Cannot find module 'ts-morph' or its corresponding type declarations.

2 import { ClassDeclaration, ClassDeclarationStructure, InterfaceDeclaration, InterfaceDeclarationStructure, ParameterDeclarationStructure, SourceFile } from 'ts-morph';
                                                                                                                                                              ~~~~~~~~~~
node_modules/@nestjs/graphql/dist/graphql-ast.explorer.d.ts:17:192 - error TS2307: Cannot find module 'ts-morph' or its corresponding type declarations.

17     lookupDefinition(item: Readonly<TypeSystemDefinitionNode | TypeSystemExtensionNode>, tsFile: SourceFile, mode: 'class' | 'interface', options: DefinitionsGeneratorOptions): void | import("ts-morph").TypeAliasDeclaration;
                                                                                                                                                                                                  ~~~~~~~~~~
node_modules/@nestjs/graphql/dist/graphql-ast.explorer.d.ts:38:143 - error TS2307: Cannot find module 'ts-morph' or its corresponding type declarations.

38     addEnumDefinition(item: EnumTypeDefinitionNode | EnumTypeExtensionNode, tsFile: SourceFile, options: DefinitionsGeneratorOptions): import("ts-morph").TypeAliasDeclaration;
                                                                                                                                                 ~~~~~~~~~~
node_modules/@nestjs/graphql/dist/interfaces/gql-gateway-module-options.interface.d.ts:1:58 - error TS2307: Cannot find module '@apollo/gateway' or its corresponding type declarations.

1 import { GatewayConfig, ServiceEndpointDefinition } from '@apollo/gateway';
                                                           ~~~~~~~~~~~~~~~~~
node_modules/@nestjs/graphql/dist/interfaces/gql-gateway-module-options.interface.d.ts:2:35 - error TS2307: Cannot find module '@apollo/gateway/dist/datasources/types' or its corresponding type declarations.

2 import { GraphQLDataSource } from '@apollo/gateway/dist/datasources/types';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 5 error(s).

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project-name@0.0.1 build: `nest build`
npm ERR! Exit status 1

Expected behavior/code

I was not expecting module or type declaration errors when migrating from @nestjs/graphql@7 to @nestjs/graphql@8. Neither migration docs nor Nest GraphQL docs mention potential issues or give instructions.

Nevertheless, rolling back @nestjs/graphql@7 resolves all build errors. So the upgrade of apollo-server-express package from 2.25.2 to 3.0.0 seems not to be the problem.

Environment


Nest version: @nestjs/[email protected] -> @nestjs/[email protected]

For Tooling issues:
- Node version: v14.17.3
- Platform:  Windows

Others:

@DaniSchenk DaniSchenk added needs triage This issue has not been looked into type: bug 😭 labels Jul 12, 2021
@kamilmysliwiec
Copy link
Member

Duplicate nestjs/graphql#1621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: bug 😭
Projects
None yet
Development

No branches or pull requests

2 participants