nestjs-graphql-best-practice icon indicating copy to clipboard operation
nestjs-graphql-best-practice copied to clipboard

Error run build or start:prod project

Open rafaneri opened this issue 3 years ago • 0 comments

I can't build the project using the "build" command nor is it possible to run the "start:prod" command successfully.

> [email protected] build /Users/rafaeldamataneri/Downloads/nestjs-graphql-best-practice-87843f95eebc7900a21997fbb9a45944e567fe03
> tsc -p tsconfig.build.json

node_modules/@nestjs/graphql/node_modules/@apollo/gateway/dist/index.d.ts:61:5 - error TS2416: Property 'load' in type 'ApolloGateway' is not assignable to the same property in base type 'GraphQLService'.
  Type '(options?: { apollo?: ApolloConfigFromAS2Or3; engine?: GraphQLServiceEngineConfig; }) => Promise<{ schema: GraphQLSchema; executor: <TContext>(requestContext: GraphQLRequestContextExecutionDidStart<...>) => Promise<...>; }>' is not assignable to type '(options: { apollo?: ApolloConfig; engine?: GraphQLServiceEngineConfig; }) => Promise<GraphQLServiceConfig>'.
    Type 'Promise<{ schema: GraphQLSchema; executor: <TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => Promise<...>; }>' is not assignable to type 'Promise<GraphQLServiceConfig>'.
      Type '{ schema: GraphQLSchema; executor: <TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => Promise<GraphQLExecutionResult>; }' is not assignable to type 'GraphQLServiceConfig'.
        Types of property 'executor' are incompatible.
          Type '<TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => Promise<GraphQLExecutionResult>' is not assignable to type 'GraphQLExecutor<Record<string, any>>'.
            Types of parameters 'requestContext' and 'requestContext' are incompatible.
              Type 'import("/Users/rafaeldamataneri/Downloads/nestjs-graphql-best-practice-87843f95eebc7900a21997fbb9a45944e567fe03/node_modules/apollo-server-core/node_modules/apollo-server-types/dist/index").GraphQLRequestContextExecutionDidStart<Record<string, any>>' is not assignable to type 'import("/Users/rafaeldamataneri/Downloads/nestjs-graphql-best-practice-87843f95eebc7900a21997fbb9a45944e567fe03/node_modules/@nestjs/graphql/node_modules/apollo-server-types/dist/index").GraphQLRequestContextExecutionDidStart<Record<string, any>>'.
                Property 'overallCachePolicy' is missing in type 'GraphQLRequestContext<Record<string, any>> & Required<Pick<GraphQLRequestContext<Record<string, any>>, "metrics" | "source" | "queryHash">> & Required<...>' but required in type 'GraphQLRequestContext<Record<string, any>>'.

61     load(options?: {
       ~~~~

  node_modules/@nestjs/graphql/node_modules/apollo-server-types/dist/index.d.ts:86:14
    86     readonly overallCachePolicy: CachePolicy;
                    ~~~~~~~~~~~~~~~~~~
    'overallCachePolicy' is declared here.

node_modules/@nestjs/graphql/node_modules/@apollo/gateway/dist/index.d.ts:90:5 - error TS2416: Property 'executor' in type 'ApolloGateway' is not assignable to the same property in base type 'GraphQLService'.
  Type '<TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => Promise<GraphQLExecutionResult>' is not assignable to type '<TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => ValueOrPromise<GraphQLExecutionResult>'.
    Types of parameters 'requestContext' and 'requestContext' are incompatible.
      Type 'import("/Users/rafaeldamataneri/Downloads/nestjs-graphql-best-practice-87843f95eebc7900a21997fbb9a45944e567fe03/node_modules/apollo-server-core/node_modules/apollo-server-types/dist/index").GraphQLRequestContextExecutionDidStart<TContext>' is not assignable to type 'import("/Users/rafaeldamataneri/Downloads/nestjs-graphql-best-practice-87843f95eebc7900a21997fbb9a45944e567fe03/node_modules/@nestjs/graphql/node_modules/apollo-server-types/dist/index").GraphQLRequestContextExecutionDidStart<TContext>'.
        Property 'overallCachePolicy' is missing in type 'GraphQLRequestContext<TContext> & Required<Pick<GraphQLRequestContext<TContext>, "metrics" | "source" | "queryHash">> & Required<...>' but required in type 'GraphQLRequestContext<TContext>'.

90     executor: <TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>) => Promise<GraphQLExecutionResult>;
       ~~~~~~~~

  node_modules/@nestjs/graphql/node_modules/apollo-server-types/dist/index.d.ts:86:14
    86     readonly overallCachePolicy: CachePolicy;
                    ~~~~~~~~~~~~~~~~~~
    'overallCachePolicy' is declared here.

node_modules/@nestjs/graphql/node_modules/apollo-server-types/dist/index.d.ts:140:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'cacheControl' must be of type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }', but here has type 'ResolveInfoCacheControl'.

140         cacheControl: ResolveInfoCacheControl;
            ~~~~~~~~~~~~

  node_modules/apollo-cache-control/dist/index.d.ts:24:9
    24         cacheControl: {
               ~~~~~~~~~~~~
    'cacheControl' was also declared here.

src/auth/jwt/index.ts:6:31 - error TS2307: Cannot find module '../../generator/graphql.schema' or its corresponding type declarations.

6 import { LoginResponse } from '../../generator/graphql.schema'
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/config/graphql/index.ts:92:5 - error TS2322: Type 'false' is not assignable to type 'ValidatorBehavior'.

92  			requireResolversForResolveType: false
    			~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@graphql-tools/utils/Interfaces.d.ts:54:5
    54     requireResolversForResolveType?: ValidatorBehavior;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from property 'requireResolversForResolveType' which is declared here on type 'IResolverValidationOptions'

src/config/graphql/plugins/complexity.plugin.ts:11:8 - error TS2307: Cannot find module 'graphql-query-complexity' or its corresponding type declarations.

11 } from 'graphql-query-complexity'
          ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/config/graphql/scalars/upload.scalar.ts:2:43 - error TS2307: Cannot find module 'graphql-upload' or its corresponding type declarations.

2 import { GraphQLUpload, FileUpload } from 'graphql-upload'
                                            ~~~~~~~~~~~~~~~~

src/config/graphql/schemaDirectives/validate.ts:13:32 - error TS2307: Cannot find module '../../../generator/graphql.schema' or its corresponding type declarations.

13 import * as GraphqlSchema from '../../../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/entities/message.entity.ts:5:22 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

5 import { User } from '../generator/graphql.schema'
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/entities/node.entity.ts:10:8 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

10 } from '../generator/graphql.schema'
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/entities/user.entity.ts:11:8 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

11 } from '../generator/graphql.schema'
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/auth.resolver.ts:5:39 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

5 import { LoginResponse, Gender } from '../generator/graphql.schema'
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/city.resolver.ts:6:33 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateCityInput } from '../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/company.resolver.ts:6:36 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateCompanyInput } from '../generator/graphql.schema'
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/department.resolver.ts:6:39 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateDepartmentInput } from '../generator/graphql.schema'
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/email.resolver.ts:6:34 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateEmailInput } from '../generator/graphql.schema'
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/form.resolver.ts:6:33 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateFormInput } from '../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/message.resolver.ts:13:36 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

13 import { CreateMessageInput } from '../generator/graphql.schema'
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/node.resolver.ts:12:8 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

12 } from '../generator/graphql.schema'
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/permission.resolver.ts:6:33 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { PermissionInput } from '../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/position.resolver.ts:6:37 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreatePositionInput } from '../generator/graphql.schema'
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/role.resolver.ts:6:33 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateRoleInput } from '../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/room.resolver.ts:6:33 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateRoomInput } from '../generator/graphql.schema'
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/store.resolver.ts:6:34 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateStoreInput } from '../generator/graphql.schema'
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/tree.resolver.ts:5:34 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

5 import { Tree as TreeType } from '../generator/graphql.schema'
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/user.resolver.ts:35:8 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

35 } from '../generator/graphql.schema'
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/resolvers/userRole.resolver.ts:6:37 - error TS2307: Cannot find module '../generator/graphql.schema' or its corresponding type declarations.

6 import { CreateUserRoleInput } from '../generator/graphql.schema'
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/shared/mail/index.ts:151:47 - error TS2345: Argument of type 'SentMessageInfo' is not assignable to parameter of type 'string'.

151  			console.log('Message sent: ' + JSON.parse(info))
     			                                          ~~~~


Found 28 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc -p tsconfig.build.json`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

rafaneri avatar Dec 02 '21 18:12 rafaneri