vulcainjs / vulcain-corejs

Microservice framework for nodejs
https://vulcainjs.github.io
Apache License 2.0
11 stars 3 forks source link

Some error when upgrading the vulcain-corejs version in my project #15

Closed workfel closed 7 years ago

workfel commented 7 years ago

Hi,

I generated my vulcain project with vulcain-cli the vulcain-corejs version it was 1.1.133. And i have upgrading the vulcain-corejs version and now the server cannot start. I just made this command npm update vulcain-corejs --save. And the new version of vulcain-corejs it's now 1.1.134.

This error happen during the compilation phase.

/Volumes/Storage/DEV/Madelink/user-service/node_modules/vulcain-corejs/dist/configurations/configurationSources/httpConfigurationSource.d.ts(2,22): error TS2420: Class 'HttpConfigurationSource' incorrectly implements interface 'ConfigurationSource'.
  Types of property 'pollPropertiesAsync' are incompatible.
    Type '(timeoutInMs: number) => Promise<{}>' is not assignable to type '(timeoutInMs: number) => Promise<PollResult>'.
      Type 'Promise<{}>' is not assignable to type 'Promise<PollResult>'.
        Type '{}' is not assignable to type 'PollResult'.
          Property 'values' is missing in type '{}'.
/Volumes/Storage/DEV/Madelink/user-service/node_modules/vulcain-corejs/dist/providers/memory/provider.d.ts(7,22): error TS2420: Class 'MemoryProvider' incorrectly implements interface 'IProvider<any>'.
  Types of property 'initializeTenantAsync' are incompatible.
    Type '(context: RequestContext, tenant: string) => Promise<() => void>' is not assignable to type '(context: RequestContext, tenant: string) => Promise<() => Promise<any>>'.
      Type 'Promise<() => void>' is not assignable to type 'Promise<() => Promise<any>>'.
        Type '() => void' is not assignable to type '() => Promise<any>'.
          Type 'void' is not assignable to type 'Promise<any>'.
/Volumes/Storage/DEV/Madelink/user-service/node_modules/vulcain-corejs/dist/providers/mongo/provider.d.ts(7,22): error TS2420: Class 'MongoProvider' incorrectly implements interface 'IProvider<any>'.
  Types of property 'initializeTenantAsync' are incompatible.
    Type '(context: RequestContext, tenant: string) => Promise<{}>' is not assignable to type '(context: RequestContext, tenant: string) => Promise<() => Promise<any>>'.
      Type 'Promise<{}>' is not assignable to type 'Promise<() => Promise<any>>'.
        Type '{}' is not assignable to type '() => Promise<any>'.
          Type '{}' provides no match for the signature '(): Promise<any>'.

How could solved this ? Thx

malain commented 7 years ago

I have the same behavior with typescript 2.4.0. Remove global typescript installation and ensures the project typescript package is 2.3.4

workfel commented 7 years ago

Yes thank you. I just changed in my devDependencies the typescript by "typescript": "2.3.4" and it's works.