vue-instantsearch icon indicating copy to clipboard operation
vue-instantsearch copied to clipboard

refinement list throw error if inside a v-if

Open marekalgoud opened this issue 5 years ago • 2 comments

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 () at e.value (chunk-vendors.js?1504162:8) at e.value (chunk-vendors.js?1504162:8) at _ (chunk-vendors.js?1504162:8) at search.js?1504162:1 at o.Ft [as _l] (chunk-vendors.js?1504162:22) at search.js?1504162:1

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

marekalgoud avatar Oct 08 '19 09:10 marekalgoud

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 :)

Haroenv avatar Oct 08 '19 11:10 Haroenv

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.

marekalgoud avatar Oct 08 '19 13:10 marekalgoud