Forum Discussion

David Drever's avatar
Jan 18, 2018
Solved

JS Files not updating in Site Assets

Ok, I have never seen anything like this before and hoping someone else has. I just finished patching our Dev and Test servers to Nov2017CU (SharePoint 2013). Since then, any solutions that are using JS injection from Site Assets are not updating. I'll make a change to the file, the library reflects that I made the change, but when I attempt to load the page accessing the js file, the changes are not reflected. Hard refreshes and full cache cleans are not affecting it. If I close and reopen my editor (VSCode) my changes are gone. When I look at the version history, the current version doesn't have my changes, but the previous version does. If I try to revert to that version, it doesn't take (still shows the previous version of the file).

 

Here's where it becomes extra weird. I have deleted the entire file from the library. Reset IIS (heck, I even rebooted the server at one time). It somehow still loads the file. The file is no longer in the library, but the server is still serving it up to the browser. I have confirmed it is not getting it from another location as the Dev tools are showing the file is located in the Asset Library the file was deleted from. Even users who have never accessed the site before are still getting that file in their browser.

This isn't limited to a single site either. I have other developers in different sub sites (same site collection) that are having the same issues.


Anyone seen this before?

  • Glen Turnbow's avatar
    Glen Turnbow
    Copper Contributor

    I took a look at your blog post with a solution. Here is what I said there:

    What about when you're using SharePoint Online? I'm working on a SharePoint site and subsites for a large organization. The main site is for one department. We have a SharePoint team, but I don't work with them. Because of that I only have access on SharePoint online. It has been squirrely for the whole time I have used it. I have gotten around it by putting both the CSS and the JavaScript in the HTML file. This is the only way to get it to update automatically. However, this is a problem for good coding practices. I really wish this would get fixed or remedied from the perspective of just writing code since I don't have access to making changes on the server.

     

    From what I have seen this has always been a problem for SharePoint.

Resources