Skip to content

npm run start:dev - error TS2345: Argument of type 'INestApplication' is not assignable to parameter of type 'INestApplication<any>' #1

@ChrisHills463

Description

@ChrisHills463

After cloning the repository and running npm install && npm run start:dev it fails with this output on Node v23:-

/app/angular-nest/node_modules/ts-node/src/index.ts:859                                                                                                                       
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);                                                                                                         
           ^                                                                                                                                                                  
TSError: ⨯ Unable to compile TypeScript:                                                                                                                                      
server/src/openapi-doc-generator.ts(47,36): error TS2345: Argument of type 'INestApplication' is not assignable to parameter of type 'INestApplication<any>'.                 
  Types of property 'enableVersioning' are incompatible.                                                                                                                      
    Type '(options?: VersioningOptions) => INestApplication' is not assignable to type '(options?: VersioningOptions) => INestApplication<any>'.                              
      Types of parameters 'options' and 'options' are incompatible.                                                                                                           
        Type 'import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").VersioningOptions' is not assignable to type 'import("/app/a
ngular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").VersioningOptions'.                                                                            
          Type 'VersioningCommonOptions & HeaderVersioningOptions' is not assignable to type 'VersioningOptions'.                                                             
            Type 'VersioningCommonOptions & import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").HeaderVersioningOptions' is no
t assignable to type 'VersioningCommonOptions & import("/app/angular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").HeaderVersioningOptions'.        
              Type 'VersioningCommonOptions & HeaderVersioningOptions' is not assignable to type 'VersioningCommonOptions'.                                                   
                Types of property 'defaultVersion' are incompatible.                                                                                                          
                  Type 'import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").VersionValue' is not assignable to type 'import("/
app/angular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").VersionValue'.
                    Type 'unique symbol' is not assignable to type 'VersionValue'.

    at createTSError (/app/angular-nest/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/app/angular-nest/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/app/angular-nest/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/app/angular-nest/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/app/angular-nest/node_modules/ts-node/src/index.ts:1617:30)
    at loadTS (node:internal/modules/cjs/loader:1826:10)
    at Object.require.extensions.<computed> [as .ts] (/app/angular-nest/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1469:32)
    at Function._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14) {
}
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: ts-node --project "/app/angular-nest/.utils/../server/tsconfig.json" --require tsconfig-paths/register "/app/angular-nest/.utils/../server/src/openapi-
doc-generator.ts"
/app/angular-nest/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
server/src/openapi-doc-generator.ts(47,36): error TS2345: Argument of type 'INestApplication' is not assignable to parameter of type 'INestApplication<any>'.
  Types of property 'enableVersioning' are incompatible.
    Type '(options?: VersioningOptions) => INestApplication' is not assignable to type '(options?: VersioningOptions) => INestApplication<any>'.
      Types of parameters 'options' and 'options' are incompatible.
        Type 'import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").VersioningOptions' is not assignable to type 'import("/app/a
ngular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").VersioningOptions'.
          Type 'VersioningCommonOptions & HeaderVersioningOptions' is not assignable to type 'VersioningOptions'.
            Type 'VersioningCommonOptions & import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").HeaderVersioningOptions' is no
t assignable to type 'VersioningCommonOptions & import("/app/angular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").HeaderVersioningOptions'.
              Type 'VersioningCommonOptions & HeaderVersioningOptions' is not assignable to type 'VersioningCommonOptions'.
                Types of property 'defaultVersion' are incompatible.
                  Type 'import("/app/angular-nest/server/node_modules/@nestjs/common/interfaces/version-options.interface").VersionValue' is not assignable to type 'import("/
app/angular-nest/node_modules/@nestjs/common/interfaces/version-options.interface").VersionValue'.
                    Type 'unique symbol' is not assignable to type 'VersionValue'.

    at createTSError (/app/angular-nest/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/app/angular-nest/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/app/angular-nest/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/app/angular-nest/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/app/angular-nest/node_modules/ts-node/src/index.ts:1617:30)
    at loadTS (node:internal/modules/cjs/loader:1826:10)
    at Object.require.extensions.<computed> [as .ts] (/app/angular-nest/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1469:32)
    at Function._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14) {
  diagnosticCodes: [ 2345 ]
}

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:882:11)
    at Object.execSync (node:child_process:954:15)
    at APIClientGeneratorLauncher.getApiDocOffline (/app/angular-nest/.utils/api-client-generator-launcher.js:56:33)
    at APIClientGeneratorLauncher.start (/app/angular-nest/.utils/api-client-generator-launcher.js:34:21)
    at Object.<anonymous> (/app/angular-nest/.utils/api-client-generator-launcher.js:102:10)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
    at Object..js (node:internal/modules/cjs/loader:1899:10)
    at Module.load (node:internal/modules/cjs/loader:1469:32) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(2699) [Uint8Array] [
       47,  97, 112, 112,  47,  97, 110, 103, 117, 108,  97, 114,
       45, 110, 101, 115, 116,  47, 110, 111, 100, 101,  95, 109,
      111, 100, 117, 108, 101, 115,  47, 116, 115,  45, 110, 111,
      100, 101,  47, 115, 114,  99,  47, 105, 110, 100, 101, 120,
       46, 116, 115,  58,  56,  53,  57,  10,  32,  32,  32,  32,
      114, 101, 116, 117, 114, 110,  32, 110, 101, 119,  32,  84,
       83,  69, 114, 114, 111, 114,  40, 100, 105,  97, 103, 110,
      111, 115, 116, 105,  99,  84, 101, 120, 116,  44,  32, 100,
      105,  97, 103, 110,
      ... 2599 more items
    ]
  ],
  pid: 934,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(2699) [Uint8Array] [
     47,  97, 112, 112,  47,  97, 110, 103, 117, 108,  97, 114,
     45, 110, 101, 115, 116,  47, 110, 111, 100, 101,  95, 109,
    111, 100, 117, 108, 101, 115,  47, 116, 115,  45, 110, 111,
    100, 101,  47, 115, 114,  99,  47, 105, 110, 100, 101, 120,
     46, 116, 115,  58,  56,  53,  57,  10,  32,  32,  32,  32,
    114, 101, 116, 117, 114, 110,  32, 110, 101, 119,  32,  84,
     83,  69, 114, 114, 111, 114,  40, 100, 105,  97, 103, 110,
    111, 115, 116, 105,  99,  84, 101, 120, 116,  44,  32, 100,
    105,  97, 103, 110,
    ... 2599 more items
  ]
}

Node.js v23.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions