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

SPFx web part/s are not loading when navigating between modern pages

Open canturan opened this issue 4 months ago • 4 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [x] 💥 Microsoft Edge
  • [x] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version: 1.12.1
  • Node.js version: 22.16
  • etc

Describe the bug / error

When navigating through modern pages or back and forth in the browser, some spfx web parts fails loading.

The error message is actually the following:

Image

What happens in the background is that the sp-page-assembly tried to remove a web part / node that does not exists and crashes.

Steps to reproduce

Place some spfx and Microsoft web parts to the page and navigate through the modern pages. When the page load is partial then the spfx web part fails loading.

Expected behavior

The web parts are loaded in any case.

canturan avatar Sep 04 '25 14:09 canturan

Hello @canturan, Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

Ashlesha-MSFT avatar Sep 04 '25 17:09 Ashlesha-MSFT

@canturan, We attempted to reproduce the issue using SPFx 1.12.1 across modern pages and SPA-style navigation but were unable to replicate the error. However, similar removeChild errors have been reported in SharePoint Online due to DOM lifecycle mismatches during partial page loads. You can refer to this related thread: https://learn.microsoft.com/en-us/answers/questions/5106786/notfounderror-failed-to-execute-removechild-on-nod

Could you confirm if your web part uses direct DOM manipulation or if the issue occurs only on client-side navigation? Also, does it persist with SPFx 1.13+?

Ashlesha-MSFT avatar Sep 05 '25 09:09 Ashlesha-MSFT

I could only able to test it with the 1.21.

You should have couple of web parts on the site, mix of SPFx and MS web parts are a good testing case.

In the web part that it happens mostly, I am not doing any DOM manipulation but the rendered components changes after page load onInit: from placeholder to actual web part. Maybe the sp-assembly could not find the Placeholder component anymore or something like that.

canturan avatar Sep 05 '25 13:09 canturan

Hi @canturan,

Thank you for providing the detailed information and context regarding the issue.

We have attempted to reproduce the behavior you described using a similar setup with SPFx versions 1.12.1 and 1.21.0 on modern SharePoint pages, including a mix of Microsoft and custom SPFx web parts. However, we have not been able to replicate the issue so far, even during client-side navigation and partial page loads.

Given the intermittent nature of the issue and the possibility that it may be related to internal page assembly behavior or specific environmental conditions, we are escalating this to our engineering team for further analysis. They will help determine whether this is a platform-level bug or an edge case scenario that requires a workaround.

We appreciate your patience and will keep you updated as we learn more.

Ashlesha-MSFT avatar Sep 09 '25 06:09 Ashlesha-MSFT