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
387 stars 340 forks source link

PnP Search Results Webpart giving Error upon first load #3601

Closed Animoticons closed 7 months ago

Animoticons commented 7 months ago

Version used 4.10.2

Describe the bug

Hello everyone

First of all thanks for developing this Webpart. Without this, we wouldn't be able to implement a good people search feature to our SharePoint Site.

Unfortunately we are running into an issue that appears consistently upon first load of the Webpart in Edge, Firefox and Chrome. For example if i restart the browser and open the Webpart or when i "Empty Cache and Hard Reload" the following Error appears:

Something went wrong If the problem persists, contact the site administrator and give them the information in Technical Details.

ERROR: e is undefined

CALL STACK: 8194/M</e.prototype.loadComponent@https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_cf26de8e2e7876cb8566c097efcc0c05.js:191:3417 8194/M</e.prototype.loadComponentById/<@https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_cf26de8e2e7876cb8566c097efcc0c05.js:191:4057

This issue appears not with any other WebParts.

To Reproduce Detailed steps to reproduce the behavior:

  1. Add WebParts "PnP - Search Box", "PnP - Search Results" and "PnP - Search Filters" to a SharePoint Page.
  2. Import configurations (See attachments) webpartproperties_Box_15_02_24.json webpartproperties_Filter_15_02_24.json webpartproperties_Results_15_02_24.json
  3. Publish the Page.
  4. Close the Browser and reopen the Browser. Upon first load, the error appears.
  5. You can also "Empty Cache and Hard Reload" to trigger the issue.
  6. Upon page reload, the error disappears and the People Search Results appear correctly.

Expected behavior The Error does not appear and the people search results show on first attempt.

Screenshots image

Desktop (please complete the following information):

Additional context The issue has existed since we use PnP Modern Search. I updated the Webpart to the latest Version, but the issue persists.

patrikhellgren commented 7 months ago

From what you describe I can only guess that it has something to do with Microsoft Graph Toolkit and the issues that has been around this historically. You don't mention from what version you have seen this and what the rest of the configuration in SharePoint looks like but I would say you have run into something like the issue mentioned in #3505. Lots of issues regarding PnP Modern Search and Microsoft Graph Toolkit (which is used by for example the people layout) will hopefully be resolved in version 4.11 of PnP Modern Search in which MGT has been updated to version 4. Looks like version 4.11 will be released shortly #3597.

wobba commented 7 months ago

You can test 4.11 pre-release to see if it solves your issue https://github.com/microsoft-search/pnp-modern-search/releases/tag/4.11.0

Animoticons commented 7 months ago

Hi Wobba Yes, 4.11 seems to have solved the issue for me, thank you!