Error when using search ui and site search - map is undefined

im using the latest search-ui (0.12) with the example code that works fine.
when changing it to use the site search connector and updating the .env file (and some other small stuff to match it)
i went on to remove all the facets etc. to have the minimum needed to have a search page. i used a search engine that already scanned one of my sites (apx. 2k pages)
I get this error in the page:

An unexpected error occurred: Cannot read property 'map' of undefined

this is the app.js:

@elitzur_e I suspect this is a case of bad error messaging.

I was able to reproduce this bug by providing an invalid "documentType" credential. I suspect there is some server error occuring, likely related to one of the following 3 problems:

  1. engineKey is invalid
  2. documentType is invalid
  3. There is no title field on your documents

In fact, it appears we have an issue in the project already to address this:

Will see about getting it fixed, in the meantime, see if you can inspect the raw API response in your browser and see if there is an error message available.

Also, the documentType should be "pages" .

Thanks. Ill try to change the docType.
As for the response, There are search results returning in the response (network tab)

@elitzur_e Oh that's interesting. Hmmm, are you able to copy / paste the API response body so I can attempt to reproduce?

its big. i added it here:

good news. got it to work. it was the documentType as you said. just "page" not "pages"

the error response could be better :slight_smile:

i think the main confusion is from the example in this line:
documentType: process.env.REACT_SITE_SEARCH_ENGINE_NAME
so it seems that the engine name sould be there...

1 Like

@elitzur_e Oh great! Yeah, we will update that documentation. Sorry that you had so much trouble with this, definitely our bad. Let me know as your project progresses if I can be of any additional help.

For Search UI specific issues, feel free to drop an issue directly in the Github repository, or, we also have a gitter channel available for live chat:

thanks jsaon for the help. the fact the you try to help as much as possible says a good deal about the futrue of this product

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.