Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old version(s) of SpFx Extension Code Displays Intermittently #864

Closed
pdemro opened this issue Sep 19, 2017 · 14 comments

Comments

Projects
None yet
@pdemro
Copy link

commented Sep 19, 2017

Category

  • Question
  • Typo
  • 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.
@mcmynn83

This comment has been minimized.

Copy link

commented Sep 20, 2017

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.

@pdemro

This comment has been minimized.

Copy link
Author

commented Sep 20, 2017

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

@tavikukko

This comment has been minimized.

Copy link

commented Sep 25, 2017

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.

@pdemro

This comment has been minimized.

Copy link
Author

commented Sep 26, 2017

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.

@dsteinweg

This comment has been minimized.

Copy link

commented Sep 26, 2017

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

@eschrader

This comment has been minimized.

Copy link

commented Jan 29, 2018

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.

@tavikukko

This comment has been minimized.

Copy link

commented Jan 30, 2018

@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.

@o-utofbounds

This comment has been minimized.

Copy link

commented Mar 9, 2018

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

@dgaeta

This comment has been minimized.

Copy link

commented Aug 13, 2018

@pdemro Are you still experiencing this issue?

@Leif-Frederiksen

This comment has been minimized.

Copy link

commented Aug 14, 2018

I am having the same issue.

Regards
Leif

@andrewconnell

This comment has been minimized.

Copy link
Collaborator

commented Jan 16, 2019

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)?

@nikskhubani

This comment has been minimized.

Copy link

commented Jan 16, 2019

Hi There,

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

#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).
@msft-github-bot

This comment has been minimized.

Copy link
Collaborator

commented Jan 23, 2019

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.

@msft-github-bot

This comment has been minimized.

Copy link
Collaborator

commented Jan 30, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.