Skip to content

Cannot extend eventemitter3 class #7439

Open

Description

@pawsong

Thank you for this great project!

I've encountered a tsc compile failure while extending eventemitter3 class.

code:

import EventEmitter = require('eventemitter3');

export default class MyEmitter extends EventEmitter { }

tsc error message:

src/MyEmitter.ts(3,40): error TS4020: Extends clause of exported class 'MyEmitter' has or is using private name 'EventEmitter'.

This issue seems to be introduced with recent change (acf0d0f), because older version of definition file (e15d282) does not make that kind of failure.

Here is full version of issue reproducing code: pawsong/tsd-eventemitter3-issue

My current workaround is using old version (e15d282). Is this a bug or am I doing something wrong?

Activity

  1. jombie commented on Apr 8, 2016

    @jombie

    Any fix for this issue.
    When trying to extend some class and try to compile with declaration true in tsconfig.json I get the following error
    error TS4020: Extends clause of exported class 'AuthenticatedRoute' has or is using private name 'Route'
    Here Route is class from react-router

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions