2

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.

  • Have you cleared your cache? Does this appear to only occur just after deploying the sppkg? As well, are there any 404's occurring in the network browser logs? – m1g Jan 14 '21 at 03:49
  • Thanks for responding. I just updated my post to answer your questions. – Kim Broskie Jan 15 '21 at 12:46
  • Long shot but are you using O365 CDN? I've heard of issues when using this in the past similar to this. Also it might be worthwhile just seeing if this happens when only one of your webparts is on the page. An underlying race condition could be the cause here. Something I would try is wrapping the oninit/render method in the core webpart file with a try/catch and log output if you don't already. SPFx I believe still might hide exceptions. – m1g Jan 16 '21 at 13:17
  • No I am not using O365 CDN. I disabled all custom extensions and added just one webpart to a page and the issue persists. I notice I am able to replicate this issue easier when I am loading multiple pages back-to-back. I tried wrapping the render method in the webpart file with a try/catch but nothing is output. – Kim Broskie Jan 20 '21 at 17:19
  • That is a difficult one. At this point, my next step would be a sanity check -- build out a new SPFx project, deploy it, and see if the error occurs to it. If it does, try the same on a different workstation/fresh install. If no issues with basic unmodified webpart, the SPFx compiler is fine and I would start cutting out logic of the webpart you linked, until it starts working again, so that you can narrow down the culprit. Hopefully issue is frequent enough to verify easily. – m1g Jan 20 '21 at 18:13

0 Answers0