question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type conflict between algoliasearch client and its usage in instantSearch

See original GitHub issue

🐛 Bug description

related to: #4911

The InstantSearch client returns upon search with the geo widget the insideBoundingBox field containing a string.

See the following test:

https://github.com/algolia/instantsearch.js/blob/6e6293046de82f90336bc857efa9d0f5fcb8e62b/src/widgets/geo-search/__tests__/geo-search-test.ts#L1717-L1721

Nonetheless the declared type dictates that it should return an array of array of numbers:

see SearchOptions types.

readonly insideBoundingBox?: ReadonlyArray<readonly number[]>;

🔍 Bug reproduction

Steps to reproduce the behavior:

  1. Create a custom searchClient for instantSearch
  2. Try to adapt insideBoundingBox
  3. TypeError
Argument of type 'readonly (readonly number[])[] | undefined' is not assignable to parameter of type 'string'.

💭 Expected behavior

They should be of same type

Environment

  • “algoliasearch”: “^4.10.5”,
  • “instantsearch.js”: “^4.30.1”,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Haroenvcommented, Oct 5, 2021

I’d need to check whether the typescript version required in algoliasearch is modern enough to allow template strings, but otherwise, feel free to make a pull request and then it will be fixed @bidoubiwa 😃

0reactions
bidoubiwacommented, Oct 11, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using InstantSearch in typescript requires to install ... - GitHub
Is it possible to use instantsearch.js in typescript without having to add ... Type conflict between algoliasearch client and its usage in ......
Read more >
Customize an InstantSearch.js widget - Algolia
When a user types a query in the search box, the results must show why the ... on a attribute already used with...
Read more >
AlgoliaSearchClient - Swift Package Index
AlgoliaSearchClient by Algolia on the Swift Package Index – ⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.
Read more >
React native Algolia Search undefined is not an object
If anybody is still looking for the answer, the reason why you're getting this error is because you did not include the property...
Read more >
How to use Algolia for instant search - LogRocket Blog
We will also need to install the algoliasearch package, Algoliasearch is an HTTP client that communicates with the Algolia API. Run the command:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found