1.3.8 Error calling function
See original GitHub issueCannot invoke an expression whose type lacks a call signature. Type 'typeof import("C:/project/node_modules/rotating-file-stream/index")' has no compatible call signatures.
I think the definition file is wrong. I would also consider not using a default export.
Issue Analytics
- State:
- Created 5 years ago
- Comments:32 (23 by maintainers)
Top Results From Across the Web
Mistake with the function add () cakephp 1.3.8 - Stack Overflow
Probably you have a mistake in your models and associations. However you can solve this problem by using loadModel before calling find on ......
Read more >FLTK 1.3.8: Common Dialogs classes and functions
FLTK calls Fl::error() to output a normal error message. The default version on Windows displays the error message in a MessageBox window. The...
Read more >utest (1.3.8) - Haxelib
Forces a failure. msg An optional error message. If not passed a default one will be used. pos Code position where the Assert...
Read more >Chapter 1 The R environment | Introduction to Spatial Data ...
Executing the function is known as a function call. The function accepts zero or ... Since we don't have an object named a...
Read more >error on very end of the checkout process - Call ... - Zen Cart Support
Fatal error: Call to undefined function zen_catalog_href_link() in ... Call to undefined function zen_catal. how do you upgrade from 1.3.8 to 1.3.9h ?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t have a example with me, but as of 1.3.7 I had
import * as rfs from 'rotating-file-stream'
and
const stream = rfs('file', opts)
.As of 1.3.7 the types were any, so there was no issue. As of the type definition in 1.3.8 I started seeing the error described above. By changing the import to
import rfs from 'rotating-file-stream', I was able to clear the error, but I was getting a null value for rfs when running the code. Honestly, in retrospect, it was probably because you define the export as RotatingFileStream, so I probably needed to do
import RotatingFileStream`, but that also underscores a reason why default exports are considered to be a bad practice… https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html@rakshith-ravi I’m not sure I understand your explanation for why you need to use default export. Other JS libraries get around it. Sure, it may take some refactoring, but it’s probably better for the health and utilization of this library in the long run.
@iccicci, I will try to clone your commit and try it out tomorrow, but I’m not sure if it relates to this issue (I could be wrong). Could you please post me a snippet of how you expect the module to be imported in TypeScript ?
I don’t think that default import/exports are a “conventional” format. They are fairly problematic and bad for maintenance. I am pretty sure TS only supports it for compatibility reasons. While libraries since VueJS have adopted it as a practice, that doesn’t make it a good TypeScript practice, and those libraries weren’t designed with TypeScript in mind, even though VueJS 3 is now on TypeScript, and have always claimed that TypeScript is supported as a first party. But I digress 😃
https://ilikekillnerds.com/2019/08/default-exports-bad https://basarat.gitbook.io/typescript/main-1/defaultisbad https://medium.com/@rajeshnaroth/avoid-es6-default-exports-a24142978a7a