microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
388 stars 341 forks source link

PnP Search Results Not Appearing on Initial Page Load #4011

Closed lindseyn86 closed 3 weeks ago

lindseyn86 commented 1 month ago

Version used Ex: 4.13.1 (but also 4.9.13)

Describe the bug When loading pages that use PnP search results webparts, the search results are not displaying. This happens randomly. The contents of the search results PnP webpart doesn't load. I have attached screenshots from dev tools that show the network and console tabs upon page load when the issue is happening.

To Reproduce We have been unable to reproduce the issue on a consistent basis. This just happens randomly on page load and we don't actually do anything to produce the issue.

Expected behavior The PNP Search results appear within the webpart.

Screenshots Image 1 - search results for events are not displaying image

Image 2 - Shows a blank webpart, but no console issues: image

Image 3 - this one shows where it failed to get the html templates, but this isn't always the case when the web part shows blank AND it shows blank on a page without an html template image

Image 4 - Random localhost request: image

Image 5 - this request DOES get results when it shows a blank PnP web part image

Image 6 - screenshot where entire body of page doesn't load, with a bunch of errors from OOTB sp-pages-assembly js: image

Desktop (please complete the following information): Google Chrome and Microsoft Edge Not using a VPN

Additional context This can only be replicated on the client's laptops.

kasperbolarsen commented 1 month ago

Nothing is as "fun" to debug as inconsistent errors. One thing I would recommend to fix is the RefinableString00 check. See https://www.techmikael.com/2014/03/s15e01-kql-basics.html , the sample "All restaurants which has a tagged location" It will not solve the issue but cleaning up the query can't hurt.

Can you test if the user has the same issue in a classic search page or the out of the box Microsoft search box

wobba commented 1 month ago

Screenshot 5. The last KQL is wrong. You should have no spaced between a property and the value.

RefinableDate >= 2024should be RefinableDate>=2024

Most errors seem to come from other web parts on the page. I see one "uncaught promise" from the search results web part, but impossible to know what this could be from the screenshot.

If you remove all other web parts from the page, do you still get intermittent issues?

Also, if you try to write KQL to ensure RefinableString00 has a value, then it's better to do NOT RefinableString00:* as called out in the documentation at https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference#filter-on-items-where-a-text-property-is-empty-or-contains-a-value

kasperbolarsen commented 3 weeks ago

@lindseyn86 any update?

lindseyn86 commented 3 weeks ago

@lindseyn86 any update?

Tried the RefinableString suggestion and that seemed to do the trick. Although we still have one individual who is experiencing the issue. We think it could be due to some setting either in her browser or on her laptop as everyone else that tested was fine. We are working on troubleshooting with her, but for the most part, it's working. Appreciate your help @kasperbolarsen !

lindseyn86 commented 3 weeks ago

We are considering the issue resolved as of now.