1000 log messages "Icon being re-registered. Ignoring duplicate registration." using Fabric React in SPFX webpart solution
I'm having a SPFX webpart solution using React and Fabric UI. In the browser log I get more than 1000 warnings about icons being re-registered. I attempted to deactivate these using the GlobalSettings for icons but that did not help.
Is this normal or am I having some ill-configured packages?

If that is indeed the case for any solution made with Fabric in SharePoint, then Microsoft is not acting professionally here. We are developing solutions. It is hard to explain to our customers (big companies) to ignore 1000 ugly warnings in the log, and it is extremely annoying to have them in there (takes memory and time) and no way to disable them. If I want to debug my solutions in Edge, I have to wait 1 minute for my log messages to appear after all these warnings, due to the slow processing.
Agreed, those warnings are very annoying during development...
You mean they don't appear in production?
Totally agree. These warnings suck up resources and lead to poor page load performance.
I think this is a SharePoint Online issue, because in "native" pages it also shows the warnings. Even the new sharepoint admin page shows them

Interesting @pedropablo, thanks for pointing that out. It seems this is happening with every clientside page (e.g. when creating a Site Page in Pages). Apparently whenever the Fabric React bundle is loaded, since the icons were registered before by SharePoint natively. The Fabric GlobalSettings defaults for icons should be adjusted so that these warnings don't appear on the console.
Agree. Needs to be a way to disable. I tried the suggestion from this article: https://github.com/OfficeDev/office-ui-fabric-react/wiki/Using-icons but first option doesn't seem to work and second option won't compile.
As pointed out earlier this cannot possibly be done by us in the extension we control, since these warnings already occur on the SharePoint side when the ClientSidePage is loaded. This is what MS should add to their call to initializeIcons.
Both calls compile for me, none have any effect. I tried the same using the GlobalSettings class.
@frevds the problem is that initializeIcons is being called multiple times. It is not pointless that there are complaints here; but something is causing an unanticipated behavior.
Whatever information you have to repro would be useful. Trying to get a dev here to help out on the SP side.
@dzearing Yeah, a SP dev taking a look at it would be great. I do have these warnings in the log for a plain ClientSidePage (Site Pages library > New Site Page). Apparently SharePoint registers the icons on its own and then loads the Fabric UI react bundle separately and registering them again. What exactly goes on under the hood is anybody's guess.
On the Fabric side - would it be possible to have a time-based aggregation of these warnings? Instead of having literally 1000+ messages of the same wording in the log for each icon one could put 1 message with 1000 icon names in it. Particularly in the Edge browser it takes more than 1 minute to actually poll all those warnings into the console (making debugging annoying, for every time you refresh the page you have to wait 1min to find your own log messages).
I am literally working on this fix right now; pr out shortly.
Great, looking forward to it.. which reminds me, this won't be coming straight into SharePoint anytime soon I'm afraid. But good to know that eventually it will.
Separately, there are devs now investigating on the sppages side to identify root cause.
The fix will be published in Fabric 6 tonight; I'm looking at cherrypicking into 5 and seeing if we can get that rolling if the devs investigating don't find the root cause sooner.
@dzearing Fabric 6 is not supported in spfx 1.6+. Is there any other alternatives to get rid of these warnings as it is impacting the page performance in production.
SP 2016 is using SPFx 1.1.0 and office-ui-fabric-react 2.31.0. This issue exist there too. What is its possible solution?
I have the same problem, the more than 1000 warnings come from this js: https://spoprod-a.akamaihd.net/files/sp-client-prod_2018-11-09.013/office-ui-fabric-react-bundle_71d81bf8e2308355fb1b83074045e6a9.js I use spfx with different versions 1.7 and 1.1.
The issue has been solved already on Fabric side. Now we have to wait till SharePoint guys updates their packages on their side...
I followed the blog https://github.com/OfficeDev/officev-ui-fabric-react/wiki/Using-icons to fix the issue. SPFx v1.1.0 doesn't support these classes, so tried with v 1.7.0 but that doesn't solve the issue.
Well I got those warnings even for empty workbench page...
Your issue might not be caused by your code.
Actually, I do not know about any way, how to force the rest of the SharePoint page to use updated Fabric even when you use it for your code...