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(vue2): handling un-namespaced vuex module #1442

Merged
merged 1 commit into from
May 18, 2021

Conversation

tsukkee
Copy link
Contributor

@tsukkee tsukkee commented May 17, 2021

I found Vue Devtools 6 fails to handle Vuex modules without namespace (namespaced = false).
The getters of that kind of modules seems to be got from module.context.getters.


add details...

I fixed the part of formatStoreForInspectorState and it is called from following part.

https://github.com/vuejs/vue-devtools/blob/d5e0579b35a7c93869ddb839e3863219202ab0ec/packages/app-backend-vue2/src/plugin.ts#L101-L114

This means getters argument of formatStoreForInspectorState is store._makeLocalGettersCache, but store._makeLocalGettersCache doesn't look includes root modules' ones and un -namespaced moduels' ones but only includes namespaced modules' ones.

So before my fixing, TypeError: Cannot convert undefined or null to object error occurs at line 350 since getters of un-namespaced modules are not contained by getters[path].

https://github.com/vuejs/vue-devtools/blob/d5e0579b35a7c93869ddb839e3863219202ab0ec/packages/app-backend-vue2/src/plugin.ts#L348-L351

@Akryum Akryum changed the title Fix handling un-namespaced vuex module fix(vue2): handling un-namespaced vuex module May 18, 2021
@Akryum Akryum merged commit d0ce8ca into vuejs:next May 18, 2021
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.

2 participants