We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
[vuex] unknown action type: wait/start
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
Using store.dispatch('wait/start', 'app loading', { root: true }) or wait/end on router.beforeEach in Vue TypeScript project.
store.dispatch('wait/start', 'app loading', { root: true })
wait/end
router.beforeEach
However, it is working fine on Vue with CommonJS project.
It should be worked without any error or warning.
There have error for unknown action type.
The text was updated successfully, but these errors were encountered:
Same problem
Sorry, something went wrong.
Same issue, but seems to work otherwise. Any workaround?
I think it is happening because when the dispatch happens, the wait store has not yet been registered, as of now I just added this line
wait
if (this.hasModule('wait')) dispatch('wait/start', 'getCartItems', { root: true })
to remove the error
@bhaskar-nair2 i have another solution
@faenir @kenzik @runyasak
guys you can try to install vue-wait as a plugin
for example create file src/plugins/vue-wait.js and configure it like u wish
src/plugins/vue-wait.js
import { createVueWait } from 'vue-wait'; const vueWait = createVueWait({ useVuex: true, vuexModuleName: 'wait', registerComponent: true, componentName: 'v-wait', registerDirective: true, directiveName: 'wait' }); export default vueWait;
and after that you can import and use it in main.js file
main.js
import store from './store'; import { createApp } from 'vue'; import vueWait from './plugins/vue-wait'; import App from './App.vue'; const app = createApp(App); app.use(store); app.use(vueWait); app.mount('#app');
No branches or pull requests
Step to reproduce
Using
store.dispatch('wait/start', 'app loading', { root: true })
orwait/end
onrouter.beforeEach
in Vue TypeScript project.However, it is working fine on Vue with CommonJS project.
Expected Behavior
It should be worked without any error or warning.
Actual Behavior
There have error for unknown action type.
Environment
The text was updated successfully, but these errors were encountered: