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

Update packaged and now I get this on my slice #1181

Closed
elira1 opened this issue Jun 15, 2021 · 4 comments
Closed

Update packaged and now I get this on my slice #1181

elira1 opened this issue Jun 15, 2021 · 4 comments

Comments

@elira1
Copy link

elira1 commented Jun 15, 2021

TS2742: The inferred type of 'usersSlice' cannot be named without a reference to '@reduxjs/toolkit/node_modules/immer/dist/internal'. This is likely not portable. A type annotation is necessary.

@markerikson
Copy link
Collaborator

We'd need to see an example that reproduces this issue. Might be worth deleting node_modules and reinstalling.

@thibaultboursier
Copy link

On my side, I had this error message because my local version of immer was not the same than @reduxjs/toolkit one.
After upgrading it to 9.0.14, it went well.

@NickBolles
Copy link

@thibaultboursier +1 looking at yarn why immer I had a few versions installed (one was from redux toolkit, others were from other dependencies). After adding a yarn resolution for the RTK one it fixed the type error. Thanks for the idea!

@ghost
Copy link

ghost commented Jan 25, 2023

Try this, next project or mono repo project, delete your node_module, package-lock.json then reinstall everything with npm i. That fixed my issue. Don't forget to restart/reload VScode for eslint to refresh.

Adding immer didn't fix my issue, and I didn't need immer to resolve it at the end.

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

No branches or pull requests

4 participants