SharePoint / SharePoint/sp-dev-docs
React Lazy Loading Causes Intermittent Crash in SPFx Web Part
@Ashlesha-MSFT is already working on this.
Since Dec 2, 2025.
- 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.
Steps to reproduce
- Load the SharePoint page with the SPFx web part containing lazy loaded React components.
- The page crashes randomly on initial load.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.