Search code examples
vue.jsvuejs3algoliavue-instant-search

Issue with Algolia Vue InstantSearch: Error with 'searchParameters' option


I'm encountering an issue with configuring Algolia using Vue InstantSearch. Specifically, I'm trying to use the widget to set search parameters, but I keep receiving the following error:

Error: The 'searchParameters' option expects an object.

I have successfully implemented pagination and basic search functionalities using Algolia Vue InstantSearch. However, when I attempt to configure search parameters using , none of the methods I've tried seem to work.

  1. Using individual props:
<ais-configure
  :hits-per-page.camel="4"
  :distinct="true"
  :enable-personalization.camel="true"
/>
  1. Using search-parameters prop directly:
<ais-configure
  :search-parameters="{
     hitsPerPage: 1
  }"
/>
  1. Attempting to bind an object:
<ais-configure
  :v-bind="{
     hitsPerPage: 1
  }"
/>

Despite these attempts, I consistently receive the error stating that the searchParameters option expects an object. The search and pagination functionalities are working as expected, which suggests that the Algolia integration itself is functional.

I would greatly appreciate any suggestions on how to correctly configure <ais-configure> correctly.


Solution

  • A similar issue was reported here.
    A pull request has since been merged regarding that issue.

    Overall, this was a bug. Now solved in [email protected], which was released on April 30th, please consider upgrading to at least that version.


    Or even v4.17.4 for the latest as of the time of writing this answer.