devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Error: Missing module "myNamespace" for path "myNamespace/" at getStoreModule

Open ijcnvv opened this issue 2 years ago • 6 comments

Version

6.0.0-beta.21

Browser and OS info

Google Chrome Version 97.0.4692.71

What is actually happening

Hi, I have many store modules in my project with dynamic keys I generated in component before registration

data() {
  return {
    namespace: generateUniqNamespace(),
  }
},
created() {
  this.$store.registerModule(this.namespace, storeModule);
},
beforeUnmount() {
  this.$store.unregisterModule(this.namespace);
}

and sometimes when I go to another page im my app, I catch this error in my console

Error: Missing module "myNamespace" for path "myNamespace/".
    at main.js?61e932ae6e09e:118733:15
    at Array.reduce (<anonymous>)
    at getStoreModule (main.js?61e932ae6e09e:118729:16)
    at main.js?61e932ae6e09e:118519:13
    at handler (backend.js:687:16)
    at DevtoolsHookable.callHandlers (backend.js:708:17)
    at DevtoolsApi.callHook (backend.js:203:26)
    at async DevtoolsApi.getInspectorState (backend.js:417:21)
    at async sendInspectorState (backend.js:2383:44)

and then I watch this error everytime even I reload my tab or close it and open again

ijcnvv avatar Jan 20 '22 10:01 ijcnvv

I have the same problem

stalker3343 avatar Feb 09 '22 12:02 stalker3343

Please provide a runnable reproduction of your issue so we can investigate.

Akryum avatar Feb 09 '22 12:02 Akryum

http://joxi.ru/E2pjGxXU4KkP4r error in console http://joxi.ru/D2PxMoGcB7bVl2

Sechet avatar Feb 09 '22 20:02 Sechet

Version 6.0.2

I've found way to reproduce:

  • first of all you need turn on Hot module replacement on bundle configuration (mine is webpack 5.68.0)
  • then choose vuex section image
  • then make some changes in component where you register store module with dynamic key and wait rebuilding's done
  • leave page or make something to unregister store module
  • that's it, this error will never be hidden, only reinstalling helps me

ijcnvv avatar Feb 11 '22 07:02 ijcnvv

I fixed issue by removing vue dev tools, making sure I was in developer mode in google chrome extensions and added vue dev tools again.

rafaelmonroy avatar Mar 22 '22 23:03 rafaelmonroy

Same here, I had to uninstall the chrome extension then re-install

torressam333 avatar Sep 02 '22 14:09 torressam333

I managed to reproduce the issue in here. The steps to follow are in the readme of the repo.

The issue seems to occur when changing the name of a namespaced module while analysing the store with the dev tools. I'm working in a project where we have a plugin that generates unique namespaces for modules, resulting in this issue being very apparent. I mocked a similar behavior in the repro project.

Let me know if I can be of more help.

thibaudszy avatar Dec 14 '22 20:12 thibaudszy

Same here, just uninstalled / reinstalled and working fine

MorningLightMountain713 avatar Dec 26 '22 01:12 MorningLightMountain713

for me what worked is, in chrome VUE-inspector - de-select the selected module in vuex section or just move to components section.

HowitzerGitHub avatar Feb 16 '23 14:02 HowitzerGitHub

I had the same problem on Firefox 113.0. Removing & adding the extension again, fixed the issue.

franzos avatar May 24 '23 17:05 franzos

Same problem.

I've created module in my code. Some time later I've removed this module.

So, in my case dev tools is speaking about unexisting module.

VueDevTools v.6.5.0

hardmagnett avatar Jun 09 '23 09:06 hardmagnett

Figure out why this error occurs.

  1. When inspecting a dynamically register module, the path of the module will be recorded in the localStorage, which is for autofocusing on that module if you do something like refreshing the page.

  2. After refreshing the page, the backend will try to autofocus the module depending on the record in localStorage, but if the module is missing, an error will be thrown. https://github.com/vuejs/devtools/blob/main/packages/app-backend-vue2/src/plugin.ts#L500-L502

  3. As long as the data in localStorage is not updated, the error will be always thrown when the page is refreshed.

Somehow I think throwing the error is not necessary, failing on fetching module is normal behavior. (As some of the modules are registered dynamically)

Azurewarth0920 avatar Aug 15 '23 13:08 Azurewarth0920

Thanks for picking this up @Azurewarth0920 !

thibaudszy avatar Aug 15 '23 20:08 thibaudszy