SharePoint / SharePoint/sp-dev-docs

React Lazy Loading Causes Intermittent Crash in SPFx Web Part

Open
#10,507 7 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Dec 2, 2025.

area:spfx sharepoint-developer-support type:bug-confirmed
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

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
  • 💥 Microsoft Edge
  • 💥 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: Chrome (142.0.7444.176)
  • SPFx version: 1.2.1
  • Node.js version: 22.16.0
Describe the bug / error

Description:

I created a SharePoint Framework (SPFx) web part where I am using React lazy loading for components. During the initial loading of the SharePoint page containing the web part, the page crashes intermittently (approximately 4 out of 10 times). After refreshing the page, the web part loads and works perfectly fine.

Investigation:

While debugging using React DevTools, I observed that one of the SharePoint page components has a Suspense fallback set to null. This is causing the entire page to suspend and results in a crash during the first load.
There is no error in console.

Image
Steps to reproduce
  1. Load the SharePoint page with the SPFx web part containing lazy loaded React components.
  2. The page crashes randomly on initial load.
  3. Refresh the page, and the web part loads successfully without errors.
Expected behavior

The SPFx web part should load reliably on the first attempt without crashing, even if React lazy loading is used.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.