sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

SharePoint Framework custom web parts stopped rendering

Open mpowney opened this issue 7 years ago • 39 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Custom Web Parts that have been developed on SPFx are rendered on a modern page as expected.

Observed Behavior

On two tenants (so far) we have home pages that are not rendering our custom SPFx web parts. None of the events of the web part rendering appear to fire (i.e. internal web part logging does not show in the browser console).

When we edit the page, and then discard the changes, the web parts initialise and render as expected.

Application Customizers that place content in the header and footer placeholders, packaged in the same solution as the custom web parts, render as expected.

Observed with solutions built on SPFx v1.4, and v1.8.

Out of 6-7 customers, on different tenants, with similar solutions as each other deployed do not experience this behaviour. So far, 2 customers (and our own) tenant are experiencing this problem.

Steps to Reproduce

  1. Browse to a modern page with custom SPFx web parts
  2. The custom SPFx web parts do not render

mpowney avatar Jul 08 '19 00:07 mpowney

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Jul 08 '19 00:07 msft-github-bot

Further investigation shows that the web part bundles do not load for the affected web parts on page load.

When I edit, and discard the changes to the page, the web part bundles load as expected, and the web parts render correctly

mpowney avatar Jul 08 '19 00:07 mpowney

Additional observation - ootb web parts (an image web part) renders correctly on first page load.

mpowney avatar Jul 08 '19 00:07 mpowney

When rendering the page with ?maintenancemode=true, we observe the following error, repeated the same number of times as there are custom SPFx web parts on the page:

TypeError: Cannot read property 'alias' of undefined
    at t.e._createWebPartTag (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:232)
    at t.e._getWebPartContext (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:232)
    at t._loadWebPartInMaintenanceMode (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:232)
    at t.loadWebPart (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:232)
    at t.n._reloadWebPart (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:185)
    at t.componentDidMount (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:185)
    at Wa (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:83)
    at Ba (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:83)
    at sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:83
    at Object.t.unstable_runWithPriority (sp-pages-assembly_en-au_feec4475b6f29ce96fe7c8c895026a56.js:97)

webparts_maintenance_mode

mpowney avatar Jul 08 '19 01:07 mpowney

What happens when you run your Web Part project on the tenant in the Workbench?

https://[tenantName].sharepoint.com/sites/[siteName]/_layouts/15/workbench.aspx

You need to track down what part of your code is invoking .alias within your Web Part.

I would start at your componentDidMount method.

I'd hazard a guess that your Web Part is polling the DOM looking for the presence of an HTML element that no longer exists (Microsoft have been regularly updating the DOM for SharePoint), or it's a built in library that has had something deprecated.

Wrap whatever code you've got in componentDidMount in a try/catch to try to isolate what's failing.

Other than that, it's impossible to guess your issue any further without code for context. Try updating dependencies one-by-one to see whether you can isolate it further.

Consider updating the project to SPFx 1.8.1 as there were a multitude of bug fixes.

Good luck, no doubt the actual team will be able to guide you better than I have.

nateforsyth avatar Jul 08 '19 01:07 nateforsyth

Hi @nateforsyth - that mention of "componentDidMount" in the stack trace isn't invoked from the custom web part code, it's part of the sp-pages-assembly-* execution stack. When this error occurs in the console, none of our custom SPFx web part bundle JS files have been loaded in to memory. The error is higher up the chain.

mpowney avatar Jul 08 '19 01:07 mpowney

I'm observing the same behaviour with a fresh "hello world" web part, with no changes, and no other custom components, on SPFx v1.8.2.

mpowney avatar Jul 08 '19 01:07 mpowney

@mpowney noted, are there any 404 errors in the console for .js files that can't be resolved? Are these deployed to an app catalog site collection?

nateforsyth avatar Jul 08 '19 01:07 nateforsyth

@nateforsyth both the customer solution, and the bare bones "hello world" solution are deployed with includeClientSideAssets enabled in package-solution.json.

No 404s, 500s, or other error HTTP code is observed in Chrome's Network tab (with disable cache enabled / disabled). All network requests are in the 200s.

mpowney avatar Jul 08 '19 01:07 mpowney

.../_layouts/15/workbench.aspx loads the custom web parts as expected.

mpowney avatar Jul 08 '19 02:07 mpowney

Are you using an external CDN to host your package/s? How are you deploying them to SharePoint? Are you using an App Catalog site collection?

nateforsyth avatar Jul 08 '19 02:07 nateforsyth

Solutions are deployed to the tenant app catalog, no CDNs are configured

mpowney avatar Jul 08 '19 02:07 mpowney

I doubt I can be of any help here. I'll leave you with this.

It's most likely unrelated, but we've been having regular issues with our SPFx Extensions and have raised a GitHub Issue for it, perhaps it might help shed some light. https://github.com/SharePoint/sp-dev-docs/issues/3802

Good luck.

nateforsyth avatar Jul 08 '19 03:07 nateforsyth

We're seeing this same issue as well, custom SPFx and some of the OOTB web parts just disappear from the page when published, it still renders the height of the web part container but the contents don't render and if we export the pages via PnP we can see the web parts defined. They just don't render after the pages are republished.

It's not happening in all our tenants, just our PROD one (they are running on GA release).

The OOTB Countdown Timer web part disappears as soon as a published page is refreshed, it appears while in edit mode after adding the web part but on publish it disappears. Old OOTB web parts seem to be working.

We see the same stacktrace when running the maintenancemode=true query string.

danwale avatar Jul 08 '19 05:07 danwale

We are seeing the same issue and have support case opened.

gristy58 avatar Jul 08 '19 05:07 gristy58

Thanks for reporting. We are actively looking into this now. Please keep on reporting the issue through Premier Support channel, if you can and have that possibility to provide us more input on the scale of the issue. As this apparently also impacts oob web parts, please do report that issue through tenant admin support channels (tenant admin UIs) if you do not have a Premier Support option.

Would also love details on this issue around the scale regardless, so that we can follow up on the issue where it happens, so please do add a comment if you are impacted on this in general regardless if you have or not reported it already with other support channels. That helps everyone to see how widely issue is impacting the service. Thx.

VesaJuvonen avatar Jul 08 '19 06:07 VesaJuvonen

Same problem here, none of our custom SPFx Web Parts are rendering. Neither are those from Plumsail which provides our forms technology, so basically we have had to halt business until this gets sorted. Please make that soon!

ColinGardner avatar Jul 08 '19 07:07 ColinGardner

Same problem here.. we even identified that the recent introduced OOTB spfx webparts like Embed, Countdown Timer, Divider, Weather, Markdown, Code Snippet is getting affected. Best of all these are provided by Microsoft. We have a Sev A with Microsoft at the moment so don't know how will they identify how to debug the issue.

prawnz avatar Jul 08 '19 09:07 prawnz

issue is being acknowledged, but no ETA for the fix at this point. Seems luckily only impact subset of tenants. Technical root cause analyses is still in progress, but advancing.

VesaJuvonen avatar Jul 08 '19 11:07 VesaJuvonen

Hope it’s fixed by the morning 40% of our clients offline and unable to do their business.

gristy58 avatar Jul 08 '19 11:07 gristy58