-
Notifications
You must be signed in to change notification settings - Fork 440
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
error TS2349: This expression is not callable when using "module": "NodeNext". #191
Comments
worked type-wise. But not when I ran the code. |
I desperately need this to be fixed |
found a tool which can check if package types are typescript valid - https://arethetypeswrong.github.io/?p=mitt%403.0.1, they're not for mitt the similar problem is discussed here: microsoft/TypeScript#52086, i tried a workaround from that thread, and it works both type-wise and the code also executes correctly import _mitt from 'mitt';
const mitt = _mitt as unknown as typeof _mitt.default; by quickly looking at that typescript issue the proper fix might require generating different upd.: or cjs output should be fixed as explained here https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md#explanation |
The problem here is with providing both ESM and CJS. This appears to be problematic when dealing with declaration files; see: I am currently looking into this |
Using mitt in Typescript with
"moduleResolution": "NodeNext"
gives "error TS2349: This expression is not callable." error.tsconfig.json
tsc --pretty --noEmit output:
The text was updated successfully, but these errors were encountered: