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

"This expression is not callable." error when using TypeScript with moduleResolution "node16" or "nodenext" #75

Closed
wojtekmaj opened this issue Jun 23, 2023 · 2 comments

Comments

@wojtekmaj
Copy link

wojtekmaj commented Jun 23, 2023

When using TypeScript with moduleResolution "node16" or "nodenext", importing clsx and using it:

import clsx from 'clsx';

clsx('a', 'b', 'c');

produces the following error:

src/index.tsx(3,0): error TS2349: This expression is not callable.
  Type 'typeof import("/node_modules/clsx/clsx")' has no call signatures.

It appears the problem is with the way typings are shipped with this library. Please read:
microsoft/TypeScript#49189 (comment)

The thread also mentions the same problem with classnames package, but it appears that they have dealt with it since then.

@wojtekmaj
Copy link
Author

Would have been fixed by #57

@lukeed
Copy link
Owner

lukeed commented Jul 15, 2023

Closed by #57

@lukeed lukeed closed this as completed Jul 15, 2023
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

2 participants