google / google/closure-compiler

MediaQueryListEvent is an unknown type

Open
#3,836 2 comments 0 reactions 0 assignees View on GitHub
triage-done
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'm getting the following error when trying to use the MediaQueryListEvent type:

**WARNING - [JSC_UNRECOGNIZED_TYPE_ERROR] Bad type annotation. Unknown type MediaQueryListEvent**

Code:
```
/**
* Handle MediaQueryList change event
* @param {MediaQueryListEvent} ev
*/
handleChange(ev) {
...
}
```

The code passes type checking in VSCode and 'Go to Definition' works.

I'm running "google-closure-compiler": "^20210601.0.0"

It looks like MediaQueryListEvent has been around for a while (https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent) so maybe it's just a missing extern?

I've tried suppressing the warning for now by adding `@suppress {checkTypes}`, but that doesn't seem to work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.