Angular 14 - error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'. Property 'prototype' is missing in type 'MockMediaQueryList' but required in type 'MediaQueryList'.
See original GitHub issueBug Report
What is the current behavior?
ng serve
build failed to compile. Shows error below
Error: node_modules/@angular/flex-layout/core/match-media/mock/mock-match-media.d.ts:59:22 - error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'.
Property 'prototype' is missing in type 'MockMediaQueryList' but required in type 'MediaQueryList'.
59 export declare class MockMediaQueryList implements MediaQueryList {
~~~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:5162:5
5162 prototype: EventTarget;
~~~~~~~~~
'prototype' is declared here.
What is the expected behavior?
Complete ng serve compile build
Which versions of Angular, Material, OS, TypeScript, and browsers are affected?
package.json below
{
"dependencies": {
"@angular/animations": "~14.2.5",
"@angular/cdk": "^14.2.4",
"@angular/common": "~14.2.5",
"@angular/compiler": "~14.2.5",
"@angular/core": "~14.2.5",
"@angular/flex-layout": "^14.0.0-beta.40",
"@angular/forms": "~14.2.5",
"@angular/material": "^14.2.4",
"@angular/material-moment-adapter": "^14.2.4",
"@angular/platform-browser": "~14.2.5",
"@angular/platform-browser-dynamic": "~14.2.5",
"@angular/router": "~14.2.5",
"@ngrx/effects": "^14.3.2",
"@ngrx/store": "^14.3.2",
"@swimlane/ngx-charts": "^20.1.0",
"jwt-decode": "^3.1.2",
"lodash-es": "^4.17.21",
"moment": "^2.29.4",
"ngx-cookie-service": "^14.0.1",
"ngx-mask": "^14.2.3",
"ngx-mat-select-search": "^5.0.0",
"ngx-pagination": "^6.0.2",
"rxjs": "~7.5.7",
"tslib": "^2.4.0",
"zone.js": "~0.11.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "~14.2.5",
"@angular/cli": "~14.2.5",
"@angular/compiler-cli": "~14.2.5",
"@faker-js/faker": "^7.5.0",
"@ngrx/schematics": "^14.3.2",
"@types/jasmine": "~4.3.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.8.4",
"@types/uuid": "^8.3.4",
"jasmine-core": "~4.4.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.1",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.8.4"
}
}
Issue Analytics
- State:
- Created a year ago
- Reactions:21
- Comments:24 (4 by maintainers)
Top Results From Across the Web
Angular 14 flex layout issue - Stack Overflow
Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'. Property 'prototype' is missing in type 'MockMediaQueryList' ...
Read more >Class incorrectly implements interface in TypeScript | bobbyhadz
The error "Class incorrectly implements interface" occurs when a class implements an interface without specifying all of the properties and methods defined ...
Read more >angular/flex-layout - Gitter
Error: node_modules/@angular/flex-layout/core/match-media/mock/mock-match-media.d.ts:59:22 - error TS2420: Class 'MockMediaQueryList' incorrectly implements ...
Read more >Angular Philippines | Live Coding with Angular: | Facebook
Angular 14 - error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'. Property 'prototype' is missing in type ...
Read more >Error TS2420: Class 'XRWebGLLayer' incorrectly implements ...
@google/model-viewer-render-fidelity-tools: Property 'prototype' is missing in type 'XRWebGLLayer' but required in type 'EventTarget'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
v14.0.0-beta.41 has been released to NPM, please upgrade to that version. Unfortunately we will not be backporting this patch to older, unsupported versions, so you have three options for mitigation on an older version:
skipLibCheck
totrue
(this is my recommendation for really any project, regardless of circumstance)I am leaving this issue open for now so that discovery is easy for impacted users.