aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.04k stars 519 forks source link

Updating to Typescript 2.5.2 produces error #1247

Closed juergenr closed 7 years ago

juergenr commented 7 years ago

Typescript <=2.4.2 and 2.5.0 works fine. Typescript >=2.5.1 gives following error:

ERROR in [at-loader] ./ClientApp/boot.server.ts:25:18 
    TS2339: Property 'onError' does not exist on type '{}'.
Trapulo commented 7 years ago

same here

nothing easy in this project :(

MarkPieszak commented 7 years ago

It depends on which template you're using, but TypeScript isn't something that can be easily updated so quickly because all of the libraries and frameworks you're working with might not have upgraded to reflect the changes they made. "Minor" versions in TS seem to have breaking changes, even if only minor ones unfortunately. 😐

juergenr commented 7 years ago

I tested with different templates, including most current. I also updated all other package to the most current version.

I think it's only one small change in line zone.onError.subscribe(errorInfo => reject(errorInfo)); of boot-server.ts to get it running, with current typscript 2.5.2.

Thanks for the great project!

mmgrt commented 7 years ago

Had this issue after updating my packages -angular template-, fixed it by defining zone along with it's type NgZone like this: const zone: NgZone = moduleRef.injector.get(NgZone);

in the boot.server.ts file.

juergenr commented 7 years ago

Making zone typesafe solves the issue. Runing current typscript 2.5.2 works now! Thank you @mmgrt!

christos-kostopoulos commented 7 years ago

const zone:any = moduleRef.injector.get(NgZone);

SteveSandersonMS commented 7 years ago

Thanks for letting us know.

When we update the template sources to TypeScript 2.5.2+ this issue will inevitably surface and we'll use one of your suggested resolutions.

Closing for now because there's no action to take on it (at least, not prior to updating to TypeScript 2.5.2).