Skip to content

Conversation

cawa-93
Copy link
Contributor

@cawa-93 cawa-93 commented Jun 5, 2020

@cawa-93 cawa-93 requested a review from sandersn as a code owner June 5, 2020 12:57
@ghost
Copy link

ghost commented Jun 5, 2020

CLA assistant check
All CLA requirements met.

@sandersn sandersn merged commit a3a5512 into microsoft:master Jun 12, 2020
@CKGrafico
Copy link

CKGrafico commented Oct 7, 2020

We still have the message "MessageEvent" is not generic when

window.addEventListener('message', (event: MessageEvent<CustomDataType>) => {})

@sapter
Copy link

sapter commented Mar 10, 2021

I'm also still getting an error Type 'MessageEvent' is not generic. @CKGrafico have you been able to resolve this or figure out why we're still getting an error? I'm on TS v4.2.2

@CKGrafico
Copy link

@sapter nop sorry, there is the worst workaround in the world :'(

 window.addEventListener('message', (event: MessageEvent) => {
      const data: PanelMessage = event.data;

@bb-in-hoodie
Copy link

There is no error underline in VSCode, but it keeps yield an error message in terminal when the code gets built.
Type 'MessageEvent' is not generic.
Is there no fix yet?

@saschanaz
Copy link
Contributor

There is no error underline in VSCode, but it keeps yield an error message in terminal when the code gets built.
Type 'MessageEvent' is not generic.
Is there no fix yet?

I think your local TypeScript version is low in that case.

@bb-in-hoodie
Copy link

I think your local TypeScript version is low in that case.

since which TS version does support this typing?
I'm on v3.9.6 for now.

210618-04-message_event_TS_error

@cawa-93
Copy link
Contributor Author

cawa-93 commented Jun 18, 2021

since which TS version does support this typing?

@bb-in-hoodie >= v4.

You can test it in playground

@bb-in-hoodie
Copy link

bb-in-hoodie commented Jun 19, 2021

Thank you 👍 I'll try it

billyvg added a commit to getsentry/downlevel-dts that referenced this pull request Jun 12, 2024
billyvg added a commit to getsentry/downlevel-dts that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the data property of MessageEvent generic

6 participants