-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
TypeError: Cannot read property '_modulesNamespaceMap' of undefined #1330
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
Comments
We did some further investigations and came to the conclusion that the |
This is because the component in the actual source code and the instance in the test code reference different Vue constructor. We cannot do anything for this in Vuex side... |
@ktsn Thanks for your quick response and very helpful answer. |
so, how to resolve this problem? |
This is already fixed on vue-test-utils. |
I'm still getting this issue with the latest verison of test utils (at time of writing). |
could you give us more detail about it |
It is not fixed because no example for it |
Please consider to use forum or chat before asking your question in already closed issue as it is not a support forum. The maintainers tend to not respond as it is marked as solved already. If it still happens on your side by other cause, please open a new issue. |
Versions
Reproduction link
https://github.com/Prior99/vuex-crash-reproduce
Steps to reproduce
yarn
yarn test
What is expected?
The unit tests should pass.
What is actually happening?
The unit tests fail with:
When changing the store module not to use namespaces by removing the
in both
src/__tests__/test-something.ts
andsrc/store.ts
and changing the lineto
in
src/some-component.vue
the error changes to:Please note that the unit test is not failing with these errors. They are logged from inside
vue.runtime.common.js
.The actual error with which the unit tests fail is:
Hints
Vue.extend
insrc/some-component.vue
the failing test passes.SomeComponent
component is used inside a parent component, hence the test insrc/__tests__/test-some-component.ts
test is passing.2.x.x
of vuex and older versions of jest and vue.This issue might be related to other issues across the web:
The text was updated successfully, but these errors were encountered: