Sp-dev-docs: Old version(s) of SpFx Extension Code Displays Intermittently

Created on 19 Sep 2017  路  15Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Sites will display the latest version of a SpFx extension after the latest version is deployed and the app is updated on the site.

Observed Behavior

Functionality intermittently changes between the latest versions and prior versions of the SpFx extension. Clearing local browser cache does not seem to have an effect. Clearing the session may fix the issue temporarily. Navigating through contents of the modern site almost always causes the extension to regress to a previous version

I figured this was a CDN caching issue at first. After several days with no changes to the SpFx extension we are still seeing an old version intermittently

Steps to Reproduce

  1. Start with a Modern site collection which has multiple pages/libraries
  2. Deploy a SpFx Application extension to SharePoint using the CDN instructions at https://dev.office.com/sharepoint/docs/spfx/extensions/get-started/hosting-extension-from-office365-cdn. In this case my application displays some content in the "Top" placeholder
  3. Make updates to the code base and deploy a new version of the SpFx app. Update the version of the app on the site
  4. Click through the site and watch the extension change functionality between different versions of the SpFx app. Clear browser cache and experience the same
  5. Wait several days (or a weekend) for the CDN to presumably flush the cache. Experience the same issue.
Author Feedback cdn spfx-general no-recent-activity duplicate

All 15 comments

Can you include a fiddler trace of a working and non working request (ie 1 where you get an old version and one where you get a new version)? If you would like to email it to grahamc at Microsoft we'll be able to take a look at this.

@mcmynn83 I sent the traces your way. Thanks for your response.

This might be related 876. In this case, office CDN is not even used, SP is serving randomly old published versions of the JS file stored in Style Library. Also recorded video about it.

This week we are getting intermittent 405/406 errors on SpFx Extension loading (below).

{"HttpStatus":"NotAcceptable","ErrorMessage":"Requested asset is not found or is not located in the Public CDN enabled location","ErrorCode":406012}

Failed to load https://publiccdn.sharepointonline.com/tenant.sharepoint.com/sites/cdn/cdn/test-application-customizer_6a9057336d4f5a5c45c3c2ca38a426fa.js: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://tenant.sharepoint.com' is therefore not allowed access. The response had HTTP status code 405. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

@mcmynn83 Any status update? In the meantime, do you have any suggestions for workarounds?

Strange, I think @tavikukko is onto something about local browser caching.
I updated a new web part I created last week with some pretty big TS code changes deleted my /sharepoint/ and /temp/ folders and repackaged it (gulp bundle --ship and gulp package-solution --ship), uploaded it to my CDN and app catalog. I tried adding the web part to the page and had to delete the zone and re-add it since its a full width web part to get it to appear.

When I add the web part I get "we're sorry.... blah" and the F12 trace shows a 406 not found. But my other SPFX extension on the page loads from the same CDN so I knew my paths were right.

Solution/workaround: I cleared my cache, opened private browsing and was able to add my web part to the page without an error.

@eschrader this is still occurring in some of my tenants. For some reason, not all frontend servers of the o365 tenant node update/sync the cache information correctly, or it can take several minutes/hours. I think it is something to do with the O365 CDN settings (a wild quess). In some tenant where I have enabled and disabled the O365 CDN, the caching problem has disappeared.

had a similar error message "No 'Access-Control-Allow-Origin' header is present" a full browser cache reset fixed the issue in my case

@pdemro Are you still experiencing this issue?

I am having the same issue.

Regards
Leif

Seems similar to #3238 #1731 #2015... may be resolved with a fix late in 2018? If this is still happening, can you please comment with an update? and more details (if possible)?

Hi There,

We faced exactly same issue and this is not related to cache. Here is the detailed information

https://github.com/SharePoint/sp-dev-docs/issues/3079

How it was fixed

I had multiple features in my solution and each feature was referencing the element file of the Extension. I had merged all feature in package-solution to single feature and it stopped creating issues.

What to do with existing deployed apps where multiple component manifests deployed

Steps are:

  1. Delete the existing app from app catalog (This is the key, this will clear junk entries from component manifest)
  2. Add it or the new version again (Doesn't matter).

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings