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

An error occurred in hook getInspectorState registered #2139

Open
steavengong opened this issue Feb 28, 2022 · 2 comments
Open

An error occurred in hook getInspectorState registered #2139

steavengong opened this issue Feb 28, 2022 · 2 comments

Comments

@steavengong
Copy link

steavengong commented Feb 28, 2022

Version

4.0.2

Reproduction link

codesandbox.io/s/feii09

Steps to reproduce

  1. vue create project-name with vuex
  2. run
  3. open with chrome
  4. update src/store/index.js add test module (namespaced: true)
  5. first time will be all right
  6. remove test module from store
  7. refresh chrome
    tell me: backend.js:710 An error occurred in hook getInspectorState registered by plugin org.vuejs.vuex
    backend.js:711 Error: Missing module "test" for path "test/"
  8. refresh chrome with clear cache also tell me that error
  9. console store
    this attribute _makeLocalGettersCache also with test/ .....

What is expected?

can clear _makeLocalGettersCache when new project run open in the web tab

What is actually happening?

An error occurred in hook getInspectorState registered by plugin org.vuejs.vuex
Error: Missing module "test" for path "test/"

but I haved remove test module
it also tell me this message

image

image

image

image

@nicklasisraelsson
Copy link

nicklasisraelsson commented Mar 24, 2022

I got this error too and I think I figured out why it happened.

I was using the vue devtools and was looking at the vuex state for the module in the devtools.
Then I removed the vuex module and started getting this error.

It seems like the dev tools caches what module is selected and when that module is not available you get this error.

The workaround for me was to select another module in the vuex state inspector in vue devtools.

@Stefanosapk
Copy link

I am having same issue when I dynamically import a module to a component, docs.

Example: Admin.vue

import AdminModule from '@/store/modules/admin.js';
export default { 
    mounted() {
        this.$store.registerModule('admin', AdminModule);
    },
    beforeDestroy() {
        this.$store.unregisterModule('admin');
    },
}

And what @nicklasisraelsson suggests, works for me as well as a fix. However this is a bit annoying because it outputs errors when you try to debug stuff from this async module and I have always to select another module before change page.

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

3 participants