algolia / jekyll-algolia

Add fast and relevant search to your Jekyll site
https://community.algolia.com/jekyll-algolia/
MIT License
214 stars 35 forks source link

Uncaught TypeError: Cannot read property 'value' of undefined #180

Closed FavorMylikes closed 3 years ago

FavorMylikes commented 3 years ago

I want to report a bug:

  var title = hit._highlightResult.title.value;  // some times
  var content = hit._highlightResult.html.value;  // other times
(index):72 Uncaught TypeError: Cannot read property 'value' of undefined

What is the current behavior?

It should happen

What is your expected behavior?

Show all correct result.

Git repository to reproduce the issue:

I have a list by github search, you can reproduce with flow. 1. [enso-org/developer-docs](https://github.com/enso-org/developer-docs) - [enso.org](https://enso.org/docs/developer/) - search `a` 2. [jbangdev/jbang.dev](https://github.com/jbangdev/jbang.dev) - [www.jbang.dev](https://www.jbang.dev/) - correct, but it use `darrenjennings/algolia-docsearch-action@master` as the action 3. [PartidoDigital/PartidoDigital-Web-Next](https://github.com/PartidoDigital/PartidoDigital-Web-Next) - [partidodigital.org.uy](https://partidodigital.org.uy/) - correct, but it use `ALGOLIA_API_KEY='${{ secrets.ALGOLIA_API_KEY }}' bundle exec jekyll algolia` as the action ### Ruby version used:

2.7 # from github pages

Jekyll version used:

4.2.0

Haroenv commented 3 years ago

The error would happen if the item isn't highlighted, or the object doesn't have that item.

This however doesn't seem related to Jekyll-algolia at all. Could you make a reproducible example and post on https://discourse.algolia.com please? Have a great day!