tiny-warning icon indicating copy to clipboard operation
tiny-warning copied to clipboard

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

Open wojtekmaj opened this issue 11 months ago • 0 comments

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 avatar Jul 12 '23 12:07 wojtekmaj