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
TypeScript error on update method: TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof "/immutability-helper/index"' has no compatible call signatures. #96
Comments
Thanks. Could you please post a code snippet so that we can reproduce the problem? |
@ajalgaonkar You need to change import statement. Use |
I believe yes, we did this change. I think it's better to just have a default export & everyone should be using |
I have hit the same problem with the typescript definition change in 2.6.5, and although changing my import from The run time error I see is:
And that is just from a standard call like:
It could be that the problem is somewhere in my webpack setup, with that not correctly identifying the default export as a function. One work around that I found is to call the
|
@DavidHall I also have the same problem like you with new version. I thought it could be the problem with webpack configuration. So I didn't report it here. |
Oh, this sounds bad, I guess it's because we have declared the I guess we'll need the typings to fix the library code to get it working, at least because the README says that an ES6 default import is a valid way of consuming the lib: |
any workaround for this? having runtime errors too. importing {newContext} does not compile for me. update: my solution to this was using the older |
@andreiglingeanu instead of: module.exports = newContext();
module.exports.newContext = newContext; we should change it to: module.exports = newContext();
module.exports.default = newContext();
module.exports.newContext = newContext; It is working after adding default export here. |
It seems like that is the way to go, a bit hacky though... I opened a PR for that, please try it |
For those who are like me:
|
Issue continues to exist on 2.7.0. Downgrading the dependency version to 2.6.4 seems to work. |
I am currently getting the following issue:
TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof "~/node_modules/immutability-helper/index"' has no compatible call signatures.
This issue does not happen on the 2.6.4 version but as soon as the solution pulled in the 2.6.5 version i started getting this issue.
For now I have made the version constant at 2.6.4, but wanted to notify you about this issue.
Thanks.
The text was updated successfully, but these errors were encountered: