vue-instantsearch
vue-instantsearch copied to clipboard
refinement list throw error if inside a v-if
Bug 🐞
What is the current behavior?
I've a refinement list inside a v-if, and it throws this error :
Error: brand.name is not defined in the disjunctiveFacets attribute of the helper configuration
at j.getDisjunctiveRefinements (chunk-vendors.js?1504162:41)
at Object.getWidgetState (chunk-vendors.js?1504162:8)
at chunk-vendors.js?1504162:8
at Array.reduce (
If instead of using a v-if, I use an hidden class it works correctly (but as I have multiple filters, It create performance issue)
Strangely, it's not the case for all my filters, some facets works others don't...
Thanks for your help.
Make a sandbox with the current behavior
I didn't manage to reproduce this bug on sandbox.
What is the expected behavior?
Same behavior if inside a v-if
Does this happen only in specific situations?
yes
What is the proposed solution?
What is the version you are using?
algoliasearch: 3.35.0 vue-instantsearch: 2.5.0
I think this might be related to slow network combined with v-if. Can you try to reproduce this in a slow network codesandbox? A reproduction will be necessary here :)
Hi @Haroenv ,
Thanks for your feedback. I've found that the only two facets which are throwing bug are "searchable" in the algolia configuration. I try to make a codepen to share with you the issue but maybe with this new information you will have a clue on what's going wrong.