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

node_modules/immutability-helper/index"' has no default export. #86

Closed
Less97 opened this issue Jan 23, 2018 · 8 comments · Fixed by #94
Closed

node_modules/immutability-helper/index"' has no default export. #86

Less97 opened this issue Jan 23, 2018 · 8 comments · Fixed by #94

Comments

@Less97
Copy link

Less97 commented Jan 23, 2018

Hi Guys a question. I'm having an annoying problem here using immutability-helper with react and typescript. In particular in this page https://github.com/kolodny/immutability-helper you say to use the following to import the update module:

import update from 'immutability-helper'.

Unfortunately recently I see that it's no longer working.The error I receive is the following:

./ClientApp/store/Counter.ts:2:8
TS1192: Module '"../node_modules/immutability-helper/index"' has no default export.

If I change it to import * as update from 'immutability-helper' I receive the error on the update.

Any idea on this?

Thanks
Alessandro

@andreiglingeanu
Copy link
Collaborator

Hello.

Can you confirm that you're on the latest version of the library?

@Less97
Copy link
Author

Less97 commented Jan 23, 2018

Hi Andrei

Thanks for your kind reply. I actually realised that it's the latest one that fails. But I saw that the 2.5.0 it seems working in my laptop while in my workstation that I had the 2.6.4 it's not. Now updating on the laptop I see it giving me the same error. I might downgrade to 2.5.0 then. But I think that definitely there's a problem in the last release.

What I can tell you though is that I'm using typescript with react+redux. So I'm not sure if typescript has an impact on this problem. If you try to install the VS2017 and select a project redux .NET core web. Adding your library should fail for 2.6.4.

Thank you very much. Downgrading could be a solution for me :-) thanks for the reply.

@andreiglingeanu
Copy link
Collaborator

The typescript is indeed the problem, we updated TS typings in the latest versions of the lib, that's where your errors are coming from. No problem, hopefully we can get to fix this problem soon!

@Less97
Copy link
Author

Less97 commented Jan 24, 2018 via email

@fabriziocucci
Copy link

Same issue here, unfortunately.

We have been doing the following as a temporary workaround (with version 2.6.4):

import { newContext } from 'immutability-helper';
const update = newContext();

Off-topic: how come there is no tag/release here on GitHub for version 2.6.4?

@Less97
Copy link
Author

Less97 commented Jan 30, 2018

Is that working for you? Because I tried that as well, I received errors during the proper update(state). At the end I moved to the version 2.5.0. But yes, there's a problem there definitely. Thanks fabrizio for letting me know!

Alessandro

@fabriziocucci
Copy link

Thanks for your prompt feedback @Less97! 👍

Is that working for you? Because I tried that as well, I received errors during the proper update(state).

Our application seems to work properly with the aforementioned workaround, i.e. the state seems to be updated correctly and I don't see any error so far.

Let me know if I can be of any help!

@Less97
Copy link
Author

Less97 commented Jan 30, 2018

I'll retry then! Thanks a lot Fabrizio!

Alessandro

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.

3 participants