SharePoint / SharePoint/sp-dev-docs
SPFx WebPart does randomly not show on SharePoint page and seems not loaded
Nobody has claimed this yet.
- 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
Windows
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
- Microsoft Edge v. 114.0.1823.58
- SPFx 1.13.1
- Node.js 14.19.0
Describe the bug / error
We developed a custom webpart in order to make a kind of advanced toolbar. This webpart has been deployed to all SharePoint sites from a specific hub (through site collection app catalogs), and installed on every sites' home pages.
The component is placed at the very top of a vertical section.
Most of the time, the component is perfectly working, and shows correctly. However, while navigating between pages through hub navigation, and completely randomly, it get not loaded correctly.
Logs
No issues in console from the component itself. Only SP issues that we already saw on other tenants or pages... I still let you the complete log:
DOM
It seems like the component is not even loaded by SharePoint Framework! DOM is empty at component location:
Site sources
I decided to look at the loaded sources thanks to the developer console in Edge. The client side assets are not even present in sources when this bug is appearing:
When component does not correctly:
When component shows correctly:
We have other components deployed on the same pages, but they show correctly. However, the same bug has already been seen on other custom SPFx components, still randomly, but less time than this one I would say.
Recurrence
This bug happens for all end users and developers working on this specific tenant.
It still seems more redundant as end user, without admin rights.
My own thinking
- Could it be related to the fact that this tenant seems really old (it get created a long time ago...)?
- Is it possible that my code generates an error that crashes the entire bundle even before it get loaded by SharePoint?
- Am I missing something? I can't explain why this one does not show up every time, and it's difficult to accept that the bug is probably generated by my code as it seems not even loaded...
Hope I provided enough information :)
Steps to reproduce
This one is quite tricky to reproduce. We are currently not able to reproduce it on other tenants with the same component in the same configuration. It seems only happening on a specific tenant.
Here is how we reproduce it on this specific tenant:
- Create multiple site collections, create site collection app catalogs on it, then deploy a custom component
- Add all these new sites to a new hub, then update hub navigation to be able to navigate between home pages
- Install this component on every sites' home pages, configure it in a really similar way
- Navigate between home pages through the Hub navigation, the bug could appear after multiple retries. We currently need about 10-20 attempts to reproduce it...
Sorry to not be able to provide more infos about how you can reproduce this issue...
Expected behavior
The component should always show itself correctly.
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.
Research direction
Start by reproducing the failure through hub navigation between the affected home pages, following the reported 10–20 attempts. Compare the Edge console, DOM at the component location, and loaded client-side sources between failing and successful visits; done means identifying a reproducible cause and ensuring the web part always appears.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100