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:
Expected behavior
Error should not occur
Error
@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.