Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: algoliasearch/lite search response: Property 'hits' does not exist on type 'SearchForFacetValuesResponse' #1574

Closed
raed667 opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@raed667
Copy link
Contributor

raed667 commented Dec 16, 2024

Description

I'm trying to use algoliasearch/lite (v5.17.1) and i'm seeing a TypeScript issue when trying to access hits from a response.

Property 'hits' does not exist on type 'SearchForFacetValuesResponse'

I saw other issues that mentioned that it should be fixed on v5.1.0 -, so I'm not sure if I'm doing something wrong.

Here is a CodeSandbox example: https://codesandbox.io/p/sandbox/y34m9l?file=%2Fsrc%2Findex.ts

Client

Search

Version

5.17.1

Relevant log output

No response

@raed667 raed667 added the bug label Dec 16, 2024
@raed667
Copy link
Contributor Author

raed667 commented Dec 16, 2024

Thanks to @shortcuts for the pointer: the trick is to use client.searchForHits instead of client.search

@raed667 raed667 closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant