algolia / vue-instantsearch

👀 Algolia components for building search UIs with Vue.js
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/vue
MIT License
854 stars 157 forks source link

Hydration fails when VueInstantsearch components are within a wrapper component #959

Closed victorth closed 1 year ago

victorth commented 3 years ago

Bug 🐞

What is the current behavior?

If a VueInstantsearch UI component like ais-refinementlist is contained within a wrapper component, say ColorFilter, hydration in Nuxt fails.

Make a sandbox with the current behavior

Refreshing the sandbox causes an unrelated error. Hence I can't get it loaded with initial state.

https://codesandbox.io/s/sweet-diffie-p73gc?file=/pages/index.vue

What is the expected behavior?

Hydration works

Does this happen only in specific situations?

It happens when there is an initial state send from the server.

What is the proposed solution?

I am not familiar with the internals as to why it's not working.

What is the version you are using?

Latest.

Always try the latest one before opening an issue.

Haroenv commented 3 years ago

This issue is quite old, sorry for not seeing it earlier, but

  build: {
    transpile: ['vue-instantsearch', 'instantsearch.js/es'],
  },

is required in nuxt.config.js

https://codesandbox.io/s/flamboyant-microservice-n6db7 is a working example