fanout / reconnecting-eventsource

A small decorator for the JavaScript EventSource API that automatically reconnects
MIT License
101 stars 19 forks source link

TS2420: Class 'ReconnectingEventSource' incorrectly implements interface 'EventSource'.   Property 'classList' is missing in type 'ReconnectingEventSource' but required in type 'EventSource'. #71

Open spyro2000 opened 1 year ago

spyro2000 commented 1 year ago

Got the above error when trying to build angular app (14.1)

image

package.json:

`"reconnecting-eventsource": "^1.6.2",

Seems like a constructor parameter classList is missing?

For some reason, it's only a problem within build/src/reconnecting-eventsource.d.ts ('esm' and 'esnext' just work fine)

image

(added the marked line by hand)

Tried with Typescript 2.4.0 and 2.5.1.

Thank you in advance, spyro

spyro2000 commented 1 year ago

Update: Never mind, seems to be a problem with ag-charts 7.x, which just overwrites EventTarget globally, requiring classList to be specified in the overwritten report. I filed a bug report: https://github.com/ag-grid/ag-grid/issues/6551