Nuxt.js and vuex: "TypeError: Cannot read property 'state' of undefined"
See original GitHub issueBug 🐞
What is the current behavior?
When including:
serverPrefetch() {
return this.instantsearch.findResultsState(this).then(algoliaState => {
this.$ssrContext.nuxt.algoliaState = algoliaState;
});
}
with Vuex action:
nuxtServerInit({ commit }) {
commit("SET_TEST", true);
}
console prints Vue warning Error in render: [Vue warn]: Error in render: "TypeError: Cannot read property 'state' of undefined"
I’m not sure if this is fixed two days ago with #864, but this version is not available through npm or yarn registry. NPM registry shows the last update to made month ago.
Make a sandbox with the current behavior
https://codesandbox.io/s/vue-instantsearch-vuex-error-1n6qp
What is the expected behavior?
Should not have an error and vuex state should be working correctly.
What is the version you are using?
Nuxt.js v2.12.2 vue-instantsearch v3.2.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
vue.js - Vuex Cannot read property 'state' of undefined
the use method accept one plugin as first parameter and options (which si optional) as second one app.use(plugin, itsOptions) , so you ...
Read more >Uncaught TypeError: Cannot read property 'state' of ...
Without understanding why this happens, I decided to report the problem. If I remove the import store from file 'src/app/auth/services/auth.js', ...
Read more >TypeError: Cannot read property of undefined (Vuex Store)
The error message states that it can't read the property description of undefined , so from that we deduce that state.collection.info is ...
Read more >vuex cannot read properties of undefined (reading 'state')
I have a spec file that mounts a very simple component that checks a value in the vuex store and creates a link....
Read more >Vuex Store (state undefined)
I have problem while setting up VueX Store My Store: import Vuex from 'vuex'; ... Error in render: "TypeError: Cannot read property 'state'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey! We’ve merged a fix for this last week, but not yet released. Will do first thing Monday!
Fixed now @eljass 👍