Shazwazza / ClientDependency

DEPRECATED. A library for managing CSS & JavaScript dependencies and optimization in ASP.Net
139 stars 65 forks source link

ERROR CDFLogger - Could not load file contents #125

Open skidmow opened 7 years ago

skidmow commented 7 years ago

Hi Shannon,

I recently deleted a JavaScript file (/scripts/videojs.js) that was no longer required in my project. The file was loaded via the ClientDependency bundler - Html.RequiresJs().

I have removed all references to the file entirely from the solution. When I deployed the change, I modified the ClientDependency version to ensure it no longer tries to the fetch the file.

When I inspect the bundled JS file that the ClientDependency serves to the browser, there is no reference to the file's functions that I removed whatsoever. Therefore Umbraco should not be attempting to load that file anymore.

However when I check the Umbraco logs, I see the following error repeatedly: ERROR Umbraco.Web.UI.CdfLogger - Could not load file contents from /scripts/videojs.js. Domain is not white-listed.

Do you have any idea of why this could be happening?

Thanks,

Nathan

Shazwazza commented 7 years ago

maybe you bumped to a version that had already been created/persisted in the cache folder?

Try clearing the CDF cache files in App_Data/ClientDependency and see what happens

skidmow commented 7 years ago

Hey Shannon. I don't think I have re-used an old version Id as I always increment. However I deleted the files from the ClientDependency folder around an hour ago and so far so good. I can't see any new CdfLogger errors. I will need to check the logs again tomorrow to be sure and get back to you.

skidmow commented 7 years ago

Hi Shannon. I have checked this again today and it's still an issue. The file is definitely not referenced anymore so I don't know why ClientDependency is trying to load it. The ClientDependency app data files were removed and the version number incremented. Could there be anything else in the App_Data folder causing this issue?

Shazwazza commented 7 years ago

Seems very odd, but no there's no additional caching apart from output caching but that will be cleared on app restart. Perhaps you have a rogue partial view or usercontrol or something that you don't know is registering a dependency that you have being loaded in your page? if you search for videojs.js in every file in your solution maybe you'll find something?

skidmow commented 7 years ago

I've searched the solution for any references and nothing is returned. I think this may be one of those unsolved mysteries. It's not firing the error every second or minute, it's quite infrequent (once every hour or so), so I think we will learn to live with it. If I do come across the reason I'll let you know. Cheers for the help.

Shazwazza commented 7 years ago

Are you running the latest cdf version? It could maybe be that a CDF request is being made to your site to include this path which could be possible if using the base64 url types. Or maybe an old version of your site was cached somewhere with an old base64 CDF link which includes this reference in it.

skidmow commented 7 years ago

Are you suggesting that there is a link some where that references an old DependencyHandler URL on our site? We did update from Umbraco 7.4.3 to 7.6.5 recently. This updated CDF from 1.8.4 to 1.9.2. Not sure if that is a factor?

I am running the latest versions of CDF: <package id="ClientDependency" version="1.9.2" targetFramework="net45" /> <package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net45" />

We are also using the base64 URL types: urlType="Base64QueryStrings"

I think is the default setting in Umbraco. However the CDF config page here https://github.com/Shazwazza/ClientDependency/wiki/Configuration is using MappedId: urlType="MappedId"

What are the differences and is there a preference?

Shazwazza commented 7 years ago

I mean maybe somewhere on the web someone has a cached html page from your site which would have a stale CDF link (DependencyHandler URL ). Since base64 links are being used, it might contain the stale paths. Base64 links are default with Umbraco because they work with load balancing. The MappedId are default with normal CDF because they are prettier and the URLs don't contain the requested paths.

skidmow commented 7 years ago

OK cool. We are load balancing so I'll be sticking with base64. If external caching is the problem I would expect this issue to just go away by itself at some point when the cache expires. I appreciate the time you have taken to help with this. Many thanks