How to pass current url to Vue Instantsearch routing during SSR?


The problem I’m experiencing is that my Algolia setup is always rendering without any initial state during SSR because it’s not receiving the ‘current url’ (which I’m pushing into the Vue Router).

On the client-side it does figure out the url though, so in the end the rendering goes fine (just not when server-side rendering).

I’m basically using the SSR setup of the Vue Instantsearch docs and Github (

In the createServerRootMixin I’m defining the routing and router object as provided on Github. I’m then expecting that either read() or onUpdate() gets called when I do router.push(context.url);. This doesn’t happen though. Is that right? Do I have to manually trigger an update on the server (whereas this happens automatically client-side)? If so, how can I tell this instantsearch router the url gets updated?

I hope someone can give some clarity on where I’m missing something :slight_smile:

(I’m using Vue Instantsearch 3.3.0 because of:


1 Like