If you know how to fix the issue, make a pull request instead.
@types/node package and had problems.Definitions by: in index.d.ts) so they can respond.I just added @types/node to my project (I'm using tsc 3.7.4), and now I get typescript errors in other seemingly unrelated dependencies when building.
% tsc --noEmit
../../node_modules/@types/pino/index.d.ts:371:34 - error TS2709: Cannot use namespace 'EventEmitter' as a type.
371 interface BaseLogger extends EventEmitter {
~~~~~~~~~~~~
../../node_modules/jest-haste-map/build/index.d.ts:125:32 - error TS2507: Type 'typeof EventEmitter' is not a constructor function type.
125 declare class HasteMap extends EventEmitter {
~~~~~~~~~~~~
It seems to be related to this refactor by @Flarna :
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/19826ba267c2203e61d28b87f56ca28eac23a994#diff-7d7d86e4d89d5a8d8e623c8873828549
in which EventEmitter is created as a namespace, probably confusing these other modules.
Reverting to 13.1 causes the errors to go away.
CC @SimonSchick
Can you please provide a minimum repro?
I don't see those issues.
I'll see what I can do; my project is pretty large. Could you try it with @types/pino?
I have the DT repo cloned locally and checked all packages that contain import { EventEmitter } from 'events'; I do not see any issues.
I'm seeing this as well when importing via import EventEmitter from 'events'; rather than import {EventEmitter} from 'events';. Using the default export worked prior to the commit @garyo referenced.
Recently I've got the same issue on one of the environments. @garyo, what exactly have you reverted to 13.1?
In that commit I reverted @types/node to 13.1 and @types/pino to ^5.15.4. That made it start working.
See comments at https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41353#issuecomment-579381008
Most helpful comment
I'm seeing this as well when importing via
import EventEmitter from 'events';rather thanimport {EventEmitter} from 'events';. Using the default export worked prior to the commit @garyo referenced.