Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eventemitter can only ve default-imported using the esModuleInterop flag #146

Closed
fabian-emilius opened this issue May 16, 2021 · 2 comments

Comments

@fabian-emilius
Copy link

I recently got the error after upgrading from 6.6.2 to 7.1.0:

node_modules/p-queue/dist/index.d.ts:1:8 - error TS1259: Module '"..../node_modules/eventemitter3/index"' can only be default-imported using the 'esModuleInterop' flag

I think this line has to be changed to import * as EventEmitter from 'eventemitter3'

import EventEmitter from 'eventemitter3';

@simllll
Copy link

simllll commented May 17, 2021

Related issue on my side: I cannot use .on().. as it says on is not a defined method, I guess because it cannot find the corret import of eventemitter

@AhmedToInfinity
Copy link

This is still an issue. Please update the import to import * as EventEmitter from 'eventemitter3'

Module '"node_modules/eventemitter3/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flagts(1259)

index.d.ts(134, 1): This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

This is because node_modules\eventemitter3\index.d.ts does not have a default export.

Thank you.

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

No branches or pull requests

3 participants