Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Null attributes causes the highlight component to throw errors #385

Closed
aarondfrancis opened this issue Jan 29, 2018 · 6 comments · Fixed by #386
Closed

Null attributes causes the highlight component to throw errors #385

aarondfrancis opened this issue Jan 29, 2018 · 6 comments · Fixed by #386

Comments

@aarondfrancis
Copy link

Do you want to request a feature or report a bug?
Bug.

Bug: What is the current behavior?
I have homeowner records in Algolia, and sometimes the owner_name can be NULL, when that's the case, the ais-highlight will throw this error over and over:

Error in render: "Error: The "owner_name" attribute is currently not configured to be highlighted in Algolia. See https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/."

Bug: What is the expected behavior?
No text is displayed for that attribute, no error is thrown. The attribute is set up for searching, one or two records just have null values!

Bug: What browsers are impacted? Which versions?
All

Bug: What is the proposed solution?
Not sure... Change this check to something more strict though: https://github.com/algolia/vue-instantsearch/blob/master/src/components/Highlight.js#L22

@aarondfrancis
Copy link
Author

I think at a very minimum, the error message should be clarified, because it sent me down the wrong path for an hour or two trying to figure out why it wasn't "configured for highlighting".

@Haroenv
Copy link
Contributor

Haroenv commented Jan 29, 2018

Seems like in your case, just changing that error to “might” and into a warning should be enough I think

@Haroenv
Copy link
Contributor

Haroenv commented Jan 29, 2018

Feel free to make a PR to any text you’d prefer!

@aarondfrancis
Copy link
Author

I think that better solution is for the ais-highlight component to happily display null values.

@ligne13
Copy link

ligne13 commented Apr 27, 2018

I also have the same issue for null attributes to be highlighted.

@Haroenv
Copy link
Contributor

Haroenv commented Apr 27, 2018

@ligne13 this has already been fixed, can you make a codesandbox of what goes wrong? There's a template here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants