I have created a number of webparts using React that I have deployed to the app catalog of a SharePoint Online site. When loading a page containing various webparts, I am randomly experiencing an issue when loading a modern page containing them. Sometimes all of the content loads fine, but other times, 1 or more of the webparts will fail to load. When they fail to load, I get the standard "Something went wrong" error with the following error and stack trace:
Something went wrong If the problem persists, contact the site administrator and give them the information in Technical Details. ERROR: n._internalInitialize is not a function
CALL STACK: mwqp/ie</e.prototype._initializeWebPart@https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_699158f7fea868eb081b869967788f85.js:1:1713443 mwqp/ie</e.prototype.loadWebPart/<@https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_699158f7fea868eb081b869967788f85.js:1:1705013
I am not sure how to resolve this issue and would appreciate help. There is nothing in the developer tools console that provides any additional information about this error. The only errors present are errors that are also present when all of the webparts do load successfully. These errors are:
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). onloadwff.js:71:799505 Uncaught ReferenceError: exports is not defined /_layouts/15/activitymonitor.js:25
I have a git repo containing the code for one of the simplest webparts that this occurs with: https://github.com/kbroskie/spfx-welcome-message
Edit to add more information: This occurs regardless of whether or not my cache has just been cleared. It occurs irrespective of browser, but I do tend to encounter this error more often on browsers other than Chrome. There are no 404's in the network logs.
This doesn't occur just after deploying an sppkg. It occurs with sppkgs that haven't been updated recently, as well as those that have.