ToddThomson / tsproject

Typescript minifier and modular typescript bundle optimizer for gulp (Ts Vinyl Adapter).
Other
57 stars 12 forks source link

Typescript error TS2322 building MinifiedTypesript example #107

Closed BurtHarris closed 4 years ago

BurtHarris commented 6 years ago

Error:

[23:09:56] Starting 'ts'...
[TsProject] Building Project with: ./src/app/tsconfig.json
[TsProject] TypeScript compiler version:  2.3.4
[TsProject] Compiling project files...
[TsProject] src/app/greeter.ts(15,9): error TS2322: Type 'Timer' is not assignable to type 'number'.
[TsProject] Build completed with errors. Outputs generated.
...

Environment: node -v: v8.9.3 npm -v: 5.5.1 os: Microsoft Windows [Version 10.0.16299.98]

Steps to reproduce:

  1. clone repository from git hub, open a command window in the directory...
  2. execute:
    npm install
    cd MinifiedTypescript
    npm install
    gulp

    Explanation:

Notes: MinifiedTypescript's package.json specifies typescript@~2.0.6, it's inheriting tsproject@~2.1.0, which depends on typescript@~2.3.2, the latest revision of which is 2.3.4. This version must have changed the return type declaration of SetTimer(), generating the above error message.

I think if tsproject used a peerDependency on typescript, rather than a dependency, then the declared dev-dependency of MinifiedTypescript's would control, and this error wouldn't appear until it's version of typescript were manually upgraded.

BurtHarris commented 6 years ago

Also note: while the error message says Build completed with errors. Outputs generated., it looks to me like outputs are actually not generated in this situation. Perhaps that's different bug.

BurtHarris commented 6 years ago

I retract previous speculation this might have been related to #106.

ToddThomson commented 6 years ago

@BurtHarris Thank-you for your input. Before addressing this issue, TsProject must be updated to utilize the latest Typescript version.

ToddThomson commented 4 years ago

The minified Greeter sample has been re-written for TsProject v4.0.