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

Incorrect types are causing errors when using TypeScript with moduleResolution set to node16 or nodenext #39

Closed
wojtekmaj opened this issue Jul 12, 2023 · 1 comment

Comments

@wojtekmaj
Copy link

When this package is used with TypeScript with moduleResolution set to node16 or nodenext, the following error will appear:

This expression is not callable.
  Type 'typeof import("file:///node_modules/tiny-warning/src/index")' has no call signatures.

Minimal reproduction:

https://www.typescriptlang.org/play?target=99&moduleResolution=99&module=100&jsx=0#code/JYWwDg9gTgLgBAdwIZQHbFQczgMyhEOAchgwE8BaZNDTIgbgChHr0sAKHJAGwGcBTADTEA8gAs4qCEQCU9IA

This is further confirmed by Are The Types Wrong:
https://arethetypeswrong.github.io/?p=tiny-warning%401.0.3

Interestingly, tiny-invariant does not have this issue.
https://arethetypeswrong.github.io/?p=tiny-invariant%401.3.1

@wojtekmaj
Copy link
Author

I simply migrated to warning. Despite not having "tiny" in its name, it's actually as tiny as tiny-warning, but has correct types.

@wojtekmaj wojtekmaj closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
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

Successfully merging a pull request may close this issue.

1 participant