Class static side 'typeof Emitter' incorrectly extends base class static side 'typeof EventEmitter'
See original GitHub issueDescribe the Bug
When building the project with TS, I get the following error:
node_modules/cloudevents/dist/transport/emitter.d.ts:48:22 - error TS2417: Class static side 'typeof Emitter' incorrectly extends base class static side 'typeof EventEmitter'.
Types of property 'on' are incompatible.
Type '(event: "newListener" | "removeListener" | "cloudevent", listener: (...args: any[]) => void) => void' is not assignable to type '(emitter: EventEmitter, event: string) => AsyncIterableIterator<any>'.
Types of parameters 'event' and 'emitter' are incompatible.
Type 'EventEmitter' is not assignable to type '"newListener" | "removeListener" | "cloudevent"'.
Type 'EventEmitter' is not assignable to type '"cloudevent"'.
48 export declare class Emitter extends EventEmitter {
~~~~~~~
"cloudevents": "4.0.0",
"@types/node": "14.14.27",
"typescript": "4.1.3"
Steps to Reproduce
N/A
Expected Behavior
Build passing.
Additional context
"cloudevents": "4.0.0",
"@types/node": "14.14.27",
"typescript": "4.1.3"
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
RN: Class static side 'typeof *' incorrectly extends base class ...
The correct fix here is to properly type the BaseModel.database return value. In this case, I believe it should return an async function,...
Read more >Class static side 'typeof Org' incorrectly extends base class ...
When trying to run the default hello:org command this is the error produced: src/commands/hello/org.ts(11,22): error TS2417: Class static side ' ...
Read more >UpgradeComponent - Angular
A helper class that allows an AngularJS component to be used from Angular. ... Part of the upgrade/static library for hybrid upgrade apps...
Read more >Is it possible to instantiate child class from a static method in ...
class Base { static find(id) { const attributes = 'foo'; ... Class static side 'typeof _Readable' incorrectly extends base class static side 'typeof...
Read more >Node.js v19.3.0 Documentation
byteLength(string[, encoding]); Static method: Buffer.compare(buf1, buf2); Static method: ... Server-side example; Client-side example; Class: Http2Session.
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
@moltar thanks for bringing this up.
Given that this is a community repo with established processes, we’ll need to discuss it. But I think it is a good suggestion. I’ve opened an issue to track this https://github.com/cloudevents/sdk-javascript/issues/388.
I’m having this issue as well in version 4.0.0.
I did some testing and it looks like it’s caused by the version of
@types/node
being used. The typescript example in this repository is using@types/node@8.9.0
which is 3 years old. I’m currently using@types/node@14.14.10
and seeing the issue, and @moltar 's example is using 14.14 as well.I downgraded to
cloudevents@3.2.0
for now and it’s compiling for me with the latest@types/node
.