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

fix: type S does not satisfy the constraint #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mickaelchanrion
Copy link

After update to the last version of nuxt@2 with typescript and typed-vuex, I get a type error for the first parameter (state) of my mutations/getters:

Parameter 'state' implicitly has an 'any' type

After inspecting the type definition of the package typed-vuex, I could see this warning for both mutationTree and getterTree:

Type 'S' does not satisfy the constraint 'Record<string, any>'.
This type parameter might need an `extends Record<string, any>` constraint.

These changes solved my problem.

@vercel
Copy link

vercel bot commented Oct 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
typed-vuex ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:02pm

@mickaelchanrion
Copy link
Author

mickaelchanrion commented Oct 11, 2023

Installing vuex@4 in my nuxt project also seems to solve my problem which makes me question this change.

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 this pull request may close these issues.

1 participant