question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong TypeScript type definitions

See original GitHub issue

Hi. I’ve just updated the package to the latest version and got this TS error:Value of type 'typeof Lru' is not callable. Did you mean to include 'new'

TS is tricked to think that the class is exported instead of the factory function. In https://github.com/avoidwork/tiny-lru/blob/master/src/lru.js#L137 we can see that the factory is exported, instead of the constructor as written here https://github.com/avoidwork/tiny-lru/blob/master/tiny-lru.d.ts#L2

Let me know if you need help with this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
avoidworkcommented, Oct 31, 2019

Closing due to #33 merging & releasing.

1reaction
avoidworkcommented, Oct 31, 2019

@fox1t ping me on twitter (at-jasonmulligan) if i miss another PR; my work is quite hectic atm and oss stuff doesn’t get any attention.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to overwrite incorrect TypeScript type definition installed ...
In order to do this: npm remove @types/dotenv . Create a folder types on your project. Copy the whole folder dotenv found in...
Read more >
Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >
Wrong Typescript type definitions for RemoteVideoTrack and ...
[X ] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in...
Read more >
TypeScript errors and how to fix them
error TS1337: An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead. Broken...
Read more >
Surviving the TypeScript Ecosystem — Part 4 - Medium
This is wrong of course, but TypeScript doesn't know the difference. However, if we are being responsible and our type definitions are accurate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found