sp-dev-docs
sp-dev-docs copied to clipboard
ListView Command Set extension suddently stopped working - only loads when page is refreshed with Ctrl+F5
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
- [X] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- Chrome 128.0.6613.85
- 1.13.1
Describe the bug / error
I am the maintainer of a SPFx package that is used in a few dozen customer tenants and contains a List View Command Set extension, a Field Customizer extension, and a web part.
Two days ago, one of my customers who has been using this package for about this year reported that the List View Command Set button had suddenly stopped displaying on multiple list pages (possibly all of the list pages where it is in use).
I have met with him to troubleshoot and observed the following:
- The extension displays without issue on Library View pages, but has an issue on List View pages.
- It displays without issue in modern List View webparts, even for the same lists where it fails to display on their regular List View page.
- If he refreshes the page with Ctrl+F5, the Command Set button displays and works correctly. But if he then refreshes the page normally, or navigates away and returns to the page, it again fails to display. The only time it displays is when the page is loaded with Ctrl+F5.
- The Field Customizer extension from the same package is working fine, even on the pages where the Command Set is having an issue.
- The Web Part from the same package is working fine, but it is not used on list view pages.
- The browser console doesn't seem to show anything pertaining to the Command Set. There are no error messages about it (or coming from it) when it fails to load, and there is no mention of it when it loads successfully. By contrast, there are log entries indicating that the Field Customizer loaded.
- There are a few differences in the console output during a successful load vs. unsuccesful load:
- When loading the page in such a way that the Command Set fails to load, there is a log line from deferred.js indicating "1526 install done". When loading with Ctrl+F5, there isn't.
- There is a "Not one page nav, start prefetch" log line that appears further down in the list of console entries when loading with Ctrl+F5 vs loading normally.
- The Network tab of the browser tools shows the SPFx package's script files being retrieved differently depending on how the page is loaded.
- When loading with Ctrl+F5 the package's script files are retrieved and the Initiator column is blank
- When loading without Ctrl+F5, the packages script files are retrieved twice - once with sp-loader-assembly as the Initiator and once with AllItems.aspx as the initiator. In both cases, the Fulfilled By column indicates
(Service Worker)
- This issue does not currently reproduce in my tenant, and none of my other customers have reported this issue, though I'm not sure how many of them are using this Command Set on a List page since using it on a Library page is more common.
What can I do to troubleshoot or remedy this issue?
Console when Command Set fails to load
Console when Command Set loads
Network requests when Command Set fails to load
Network request when Command Set loads
Steps to reproduce
Currently I only know this to reproduce in my customer's environment.
- Navigate to a list page that has the Command Set extension configured
- View the command bar
Expected behavior
The Command Set button should display.