Pnp-modern-search: Intermittent fault with search web parts

Created on 29 Jan 2020  路  9Comments  路  Source: microsoft-search/pnp-modern-search

Version used
Ex: 3.8.0

Describe the bug
There seems to be an intermittent issue caused when navigating in a SharePoint site to different pages which each have an instance of the search results and search refiners webpart added to them. Sometimes you see the attached error

On refreshing the page the error goes away. Further if you navigate by opening in a new tab the issue is not reproduced.

To Reproduce
Steps to reproduce the behavior:

  1. Create search results webpart and associated refiners on a few pages within a site collection
  2. add links in the SharePoint nav and use these to navigate to the various pages containing the webparts.
  3. Intermittently, you will see the attached error. This has been replicated by many users in my tenancy but again the issue is intermittent. Given the nature of the error this looks to be more fundamental that the webpart config, perhaps to do with how the webparts are communicating with each other.

Expected behavior
Error should not occur

Error
Something went wrong

All 9 comments

@FranckyC I'm not sure if the 3.9.0 fix resolves this behavior? I couldn't see a direct ref in the change log.

Hi @mag210, I will perform some tests to see what's going on. Thanks.

Full error from my console attached
console-error.txt
: The key bit I think is:
Uncaught (in promise) Error: *The "DynamicData" object cannot be used because it has been disposed.

I think that when you navigate between pages in SharePoint, it's caching heavily and this seems to be causing issues with the webpart connection when you have multiple instances of it. Note the issue is not reproduced when you open the page in a new tab or do a full refresh...

This PR should have resolved this https://github.com/microsoft-search/pnp-modern-search/pull/34. Weird.

Is that PR in the Jan release? I'm currently running the December one

Should be in the latest release.

Good stuff, I'll update to the Jan release and let you know if we can still see the same error

@mag210 Does the latest release resolve the issue?

@FranckyC , I've deployed to my environment today and can confirm that the data disposal issue and associated error has been resolved. One point to note is that if you copy a page which has the search webpart and filter setup and setup navigation between the two pages, you will see filters being referenced incorrectly. To work round, you just create a new page with a new instance of the search webpart and you do not get the issue.

Was this page helpful?
0 / 5 - 0 ratings