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

List view command set extension fails to load after the page is reloaded. Doing a "hard refresh" does not make any difference, but clearing all site data (F12 > Application > Storage > Clear site data) brings it back - until you reload the page and it disappears again.

Open SPJS opened this issue 1 year ago • 6 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
  • [ ] 💥 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: 129.0.6668.90 (Official Build) (64-bit)
  • SPFx version: 1.17.4

Describe the bug / error

When you reload the page after first installing a command set extension the command set fails to load. The only way to make it reappear is to use the developer tools > Application > Storage > Clear site data and then reload the page. image

This only works until you reload the page again - then it disappears again!

The console output while reloading the page (when the command set is not loaded): image

Steps to reproduce

  1. Create the default hello-world Command Set SPFx: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api
  2. Open a list in the browser and you will see the “Command Two” button visible.
  3. Do a normal page reload and the “Command Two" button is not visible.
  4. If you go to developer tools > Application > Storage and clicks “Clear site data” and reloads the page, the “Command Two” button reappears.
  5. Doing a new normal page reload causes the command set extension to fail loading again.

Expected behavior

The command set extension should always load with the list view.

SPJS avatar Oct 06 '24 08:10 SPJS

Hello, We are facing the exact same issue with our SPFx solutions deployed across many different customer tenants. It appears to be a bug introduced by Microsoft with the "new" experience updates in August. After researching on Google and in this forum, I found two potential solutions: 1st solution (confirmed that helped): Change the "Offline Client Availability" setting to "No" (List => Settings => Advanced Settings). It seems this setting changes the list mode and prevents the use of "new" experience features. image 2nd solution (unconfirmed): Try updating the SPFx solution to use at least the SPFx 1.18 or 1.19 version libraries. We have updated our SPFx version, but our customers have not yet deployed the new SPFx package, so I cannot confirm if this resolves the issue. Hope this helps.

EnovaPoint-Martin avatar Oct 07 '24 08:10 EnovaPoint-Martin

@SPJS is your list Syncing (in the header area where you see the list's name, you'll also see either a checkmark or a little circle of arrows)? When it's syncing, command set customizations won't load currently. You can set a list to stop syncing by going to the Lists App.

reedpamsft avatar Oct 07 '24 15:10 reedpamsft

*** Removed - I replied to the wrong issue ***

Alexander

SPJS avatar Oct 07 '24 17:10 SPJS

@reedpamsft Sorry If I confused you - I have two tickets open and thought I replied to the other one: https://github.com/SharePoint/sp-dev-docs/issues/9953

To answer in the right "context": Disabling sync does not help to keep the command set visible - it requires a hard refresh to stay visible.

Alexander

SPJS avatar Oct 07 '24 17:10 SPJS

@SPJS would you mind taking a network trace for this issue (the one being discussed in this thread)? This is not something I have been able to reproduce, except when Sync is turned on.

reedpamsft avatar Oct 07 '24 17:10 reedpamsft

@reedpamsft It looks like it suddenly started working! I was preparing to do the network trace, but now I cannot replicate it again. I have done a lot of testing over the weekend where I had this problem all the time so I guess this must have been fixed already.

Alexander

SPJS avatar Oct 07 '24 17:10 SPJS

Hello @SPJS, Thank You for your patience. Is the issue resolved now?

Amey-MSFT avatar Apr 18 '25 05:04 Amey-MSFT

Yes, this works now - thanks.

Alexander

SPJS avatar Apr 18 '25 15:04 SPJS