flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

Cannot compile with typescript 3.1.1

Open olaf89 opened this issue 8 years ago • 60 comments

Bug Report

What is the expected behavior?

Cannot compile with typescript 3.1.1

What is the current behavior?

Im getting following errors:

ERROR in node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(25,15): error TS2416: Property '_registry' in type 'MockMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type 'Map<string, MockMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
    Type 'MockMediaQueryList' is not assignable to type 'MediaQueryList'.
      Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(63,22): error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'.
  Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(80,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(82,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(11,22): error TS2420: Class 'ServerMediaQueryList' incorrectly implements interface 'MediaQueryList'.
  Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(28,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(30,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(42,15): error TS2416: Property '_registry' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type 'Map<string, ServerMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
    Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.
      Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(54,15): error TS2416: Property '_buildMQL' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type '(query: string) => ServerMediaQueryList' is not assignable to type '(query: string) => MediaQueryList'.
    Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.

What are the steps to reproduce?

Compile app using typescript 3.1.1 and flex-layout 6.0.0-beta.18

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

olaf89 avatar Sep 28 '18 05:09 olaf89

We'll need to wait for Material to update to TS v3.1.x before we move, because we have a peer dependency on the CDK. They'll likely update once Angular v7 goes into RC in the next few weeks.

CaerusKaru avatar Sep 28 '18 15:09 CaerusKaru

Angular 7 RC is out, Angular Material and CDK has a beta, is there any way i can use flex-layout with ng 7rc ?

matheusdavidson avatar Oct 02 '18 00:10 matheusdavidson

See https://github.com/angular/material2/pull/13359

CaerusKaru avatar Oct 02 '18 01:10 CaerusKaru

Blocked on https://github.com/angular/material2/pull/13384

CaerusKaru avatar Oct 02 '18 01:10 CaerusKaru

material2 7.0.0-rc.0 release

xmlking avatar Oct 02 '18 23:10 xmlking

Yep, thankfully https://github.com/angular/material2/pull/13384 and https://github.com/angular/material2/pull/13359 were merged and 7.0.0-rc.0 has been released.

This library and @angular/fire are the two holding me back from fully testing the RC atm.

Thanks for the hard work @CaerusKaru!

Splaktar avatar Oct 03 '18 01:10 Splaktar

I've added the necessary patches in #855, and CI looks good, so we should be able to get this merged into the nightly tomorrow, targeting a 7.0.0 release either late this week or early next week.

CaerusKaru avatar Oct 04 '18 05:10 CaerusKaru

I installed the nightly via "@angular/flex-layout": "https://github.com/angular/flex-layout-builds#7.0.0-beta.19-2401536", but I am still seeing the same kind of failures:

BUILD ERROR
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(25,15): error TS2416: Property '_registry' in type 'MockMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type 'Map<string, MockMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
    Type 'MockMediaQueryList' is not assignable to type 'MediaQueryList'.
      Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(63,22): error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'.
  Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(80,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(82,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(11,22): error TS2420: Class 'ServerMediaQueryList' incorrectly implements interface 'MediaQueryList'.
  Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(28,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(30,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(42,15): error TS2416: Property '_registry' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type 'Map<string, ServerMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
    Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.
      Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(54,15): error TS2416: Property '_buildMQL' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
  Type '(query: string) => ServerMediaQueryList' is not assignable to type '(query: string) => MediaQueryList'.
    Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.

I'm not sure if I need to wait for the NPM release or if I'm doing something wrong here.

I tried the instructions here including rm -rf node_modules/, but got the same result.

Splaktar avatar Oct 08 '18 09:10 Splaktar

You’re not doing anything wrong. Somehow along the way I did everything except actually upgrade the version of TS. I’ll do that now.

CaerusKaru avatar Oct 08 '18 13:10 CaerusKaru

@Splaktar should be fixed with latest commit. Please let me know of any ill-effects by filing a new issue.

CaerusKaru avatar Oct 08 '18 15:10 CaerusKaru

@CaerusKaru When the Beta.19 will be released? Thanks for the great work!

mattma avatar Oct 08 '18 16:10 mattma

@mattma see #859

CaerusKaru avatar Oct 08 '18 16:10 CaerusKaru

Thanks, https://github.com/angular/flex-layout/pull/860 does indeed resolve this for me in the latest build.

Splaktar avatar Oct 08 '18 17:10 Splaktar

use previous version of flex i.e before 7.0.0-beta.19 Compile app using typescript 3.1.1 and flex-layout 6.0.0-beta.18

npm install @angular/[email protected]

sanketdambhe avatar Oct 10 '18 18:10 sanketdambhe

npm install @angular/[email protected]

Getting this error

ERROR in node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(72,67): error TS1144: '{' or ';' expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,5): error TS1128: Declaration or statement expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,33): error TS1005: ';' expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,39): error TS1109: Expression expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(79,5): error TS1128: Declaration or statement expected.
node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(80,1): error TS1128: Declaration or statement expected.

tan2411 avatar Oct 10 '18 18:10 tan2411

@sanketdambhe is there a question?

@tan2411 beta.18 isn't supported with TypeScript 3.1.1. You need to use 7.0.0-beta.19.

Splaktar avatar Oct 11 '18 00:10 Splaktar

use previous version of flex i.e before 7.0.0-beta.19 Compile app using typescript 3.1.1 and flex-layout 6.0.0-beta.18

npm install @angular/[email protected]

Thanks! It works for me.

daniszm avatar Oct 12 '18 08:10 daniszm

@tan2411 beta.18 isn't supported with TypeScript 3.1.1. You need to use 7.0.0-beta.19.

Getting following error using @angular/[email protected] ERROR in node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(25,15): error TS2416: Property '_registry' in type 'MockMatchMedia' is not assignable to the same property in base type 'MatchMedia'.

tried @angular/[email protected] getting following error: ERROR in node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(72,67): error TS1144: '{' or ';' expected. node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,5): error TS1128: Declaration or statement expected. node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,33): error TS1005: ';' expected. node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(74,39): error TS1109: Expression expected. node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(79,5): error TS1128: Declaration or statement expected. node_modules/@angular/flex-layout/extended/typings/style/style.d.ts(80,1): error TS1128: Declaration or statement expected.


Angular CLI: 6.1.5 Node: 8.11.4 OS: linux x64 Angular: 6.1.7 ... common, compiler, compiler-cli, core, forms, http ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version

@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 0.7.5 @angular/animations 6.1.10 @angular/cdk 6.4.7 @angular/cli 6.1.5 @angular/flex-layout 6.0.0-beta.18 @angular/material 6.4.7 @ngtools/webpack 6.1.5 @schematics/angular 0.7.5 @schematics/update 0.7.5 rxjs 6.0.0 typescript 2.7.2 webpack 4.9.2

tan2411 avatar Oct 14 '18 03:10 tan2411

@tan2411 you should have seen some errors when you installed 7.0.0-beta.19 like this:

npm WARN @angular/[email protected] requires a peer of @angular/cdk@^7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@>=7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@>=7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.

This is because Angular ^7.0.0-rc.0 is required and you are running 6.1.10.

Splaktar avatar Oct 14 '18 07:10 Splaktar

@sanketdambhe the comment that you posted in this thread is off topic from the OP (TypeScript 3.1.1 support). It should have been opened as a separate issue. No need to do that now though.

Splaktar avatar Oct 14 '18 07:10 Splaktar