Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error after Angular & flexLayout upgrade - MediaQueryListEvent not assignable of type MediaQueryList #973

Closed
vijender1256 opened this issue Jan 8, 2019 · 3 comments

Comments

@vijender1256
Copy link

vijender1256 commented Jan 8, 2019

export class LayoutComponent implements OnInit, OnDestroy {

  private _router: Subscription;

  mediaMatcher: MediaQueryList = matchMedia(`(max-width: ${SMALL_WIDTH_BREAKPOINT}px)`);
  url: string;
  sidePanelOpened;

  constructor (
    private _element: ElementRef,
    private router: Router) {
    this.mediaMatcher.addListener(mql => zone.run(() => {
      this.mediaMatcher = mql; //i am getting error here Type 'MediaQueryListEvent' is not assignable to type 'MediaQueryList'.
                  //Property 'onchange' is missing in type 'MediaQueryListEvent'.
    }));
  }

  }

I have upgraded my angular 5.2 to 7.2.0 & "@angular/flex-layout": "^7.0.0-beta.22", typescript version : 3.2.2,, I am getting build error "MediaQueryListEvent" is not assignable of type MediaQueryList. Is this issue exists with current version of flexLayout ?

@CaerusKaru
Copy link
Member

Duplicate of #861

@CaerusKaru CaerusKaru marked this as a duplicate of #861 Jan 8, 2019
@vijender1256 vijender1256 changed the title Build error after Angular & flexLayout upgrade - MediaQueryListEvent not assinable of type MediaQueryList Build error after Angular & flexLayout upgrade - MediaQueryListEvent not assignable of type MediaQueryList Jan 8, 2019
@vijender1256
Copy link
Author

vijender1256 commented Jan 8, 2019

@CaerusKaru As mentioned above , I am using Angular 7.2.0, @angular/cdk 7.2.1 , @angular/cli 7.1.4 , typescript 3.2.2 & @angular/flex-layout": "7.0.0-beta.22. The answer provided in issue #861 did not fix it for the above mentioned version, do you want us to downgrade the typescript ?, downgrading typescript to 3.1.1 with Angular 7.2.0 giving more errors, please help us out

@CaerusKaru
Copy link
Member

And I'm going to respond by saying that this is very much not a Flex Layout issue. It's likely you need to rebuild your dependencies. See #851 for the full story.

@angular angular locked as resolved and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants