-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent errors on people search results with mgt-mock-provider registration #2140
Comments
Follow-up I found this thread @microsoft/mgt-spfx pnp modern search uses '@microsoft/mgt/dist/es6' |
The component fails when we use @microsoft/mgt-spfx. See #1127 |
We could track the problem down and it is now easily reproductible:
We have tried to adapt our dummy test webpart with the official mgt-package but the error persists. |
Can you retry using v4.8 as I rewrote the mgt impl a little bit? |
Tried with v4.8 |
Then I'm not sure what the solution is as it seems mgt related - which is a component we re-use. And mgt works fine using one web part at least. Seems like a race condition of sorts with multiple parts. |
Thanks ! |
@ferrarirosso, the issue is because you try to load MGT components multiple times on the page (from mgt-react and from PnP WebParts). Can you try to enable MGT on only one PnP WebPart and let other WebParts assume MGT is loaded on the page? |
@FranckyC
|
@ferrarirosso do you get a full page refresh when switching to page B? |
@FranckyC I think when you go from sitea/pagea to siteb/pageb through the standard top search box, you get a page refresh. |
Can you open the network tab from your browser and see if MGT is loaded multiple times when switching pages? |
@FranckyC maybe dispose issue of mgt on page nav.... |
@ferrarirosso is there more to the error message "already been used"? As seen in https://stackoverflow.com/questions/70335990/%C3%97-notsupportederror-failed-to-execute-define-on-customelementregistry-the it should say what package it has been registered with. |
Seems some race condition when you have multiple web parts. I'll see if I can figure out a workaround somehow. |
@ferrarirosso Can you download https://1drv.ms/u/s!AsQPRl4COMyeosR1swAobiv6_qIuHg?e=t67lhS and see if you can repro the issue with this version? I'm not able to repro myself so trying some things. |
Got it.. the issue is that mgt is loaded on page, and as SP uses smart navigation, then pnp search web parts tries to reload. I'll take another shot at this. |
@ferrarirosso can you use the same link and re-test. Added an extra check I think hope solved it. |
CDN errors are intermittent. Wait, clear browser cache, retry. |
Great, started a private browser session. |
I'll publish my PR tomorrow 🙂 |
Comitted in the dev branch. |
Version used
4.5.4.3
Describe the bug
We have a search results page with the following setup :
We receive the following intermittent errors when displaying search results :
FEHLER:
Failed to execute 'define' on 'CustomElementRegistry': the name "mgt-mock-provider" has already been used with this registry
AUFRUFLISTE:
Error: Failed to execute 'define' on 'CustomElementRegistry': the name "mgt-mock-provider" has already been used with this registry
at https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:189:15976
at https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:189:15991
at a (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:418:4419)
at Object.JHPj (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:418:4807)
at i (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_e74c141135066849eb54.js:1:799)
at Module.KTOQ (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:422:2484)
at i (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_e74c141135066849eb54.js:1:799)
at Module.nVLA (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/chunk.vendors~microsoft-graph-toolkit_a0d5d9237e6d504060d1.js:2239:7518)
at i (https://publiccdn.sharepointonline.com/mytenant.sharepoint.com/sites/apps/ClientSideAssets/59903278-dd5d-4e9e-bef6-562aae716b8b/modern-search-results-web-part_e74c141135066849eb54.js:1:799)
The error is emitted from the people result webpart in the default vertical
Additional Content
Questions
The text was updated successfully, but these errors were encountered: