November Happy Hour will be moved to Thursday December 5th.

404 on ClientResources files all of a sudden after upgrade to 12.23

Vote:
 

I just noticed that none of my files in ClientResources are being loaded after an upgrade to CMS 12.23 and just returns 404. They've worked on earlier versions of CMS 12 (although hard to say on which version they worked in).

Has there been any breaking changes regarding this? I can't find anything usefull when I seach for information.

module.config hasn't been altered in months as well.

#311697
Oct 30, 2023 14:19
Vote:
 

Have you 

  • Cleaned your solution? dotnet clean or similar, even manually removed all obj folders etc
  • Cleaned your nuget package folders? Either in the solution or in %userprofile%\.nuget\packages, sometimes both
  • Ensured you have a licensefile that your site can reach? ClientResources typically don't load unless.
#311698
Edited, Oct 30, 2023 14:32
Vote:
 

It's the same problem up on DXP integration environment as well I'm afraid so it's not only local (and I've double checked that the files exist on disk).

#311699
Oct 30, 2023 14:34
Vote:
 

I guess you were affected by this bug fix Vulnerability in CMS 12 shell module configuration | Optimizely D

due to its nature I can't disclose more information publicly. But you're welcome to contact developer support service for further assistance. 

#311700
Oct 30, 2023 14:41
Vote:
 

Can you load the file in the browser? 

The error indicates the issue is a bad mime-type.

#311701
Oct 30, 2023 14:42
Vote:
 

Quan: Great, I'll email support.

Eric: No, unfortunatelly not.

#311702
Oct 30, 2023 14:43
Vote:
 

Got an answer from support now.

You need to move ClientResource-folder to wwwroot (or to your desired static asset location if you have an upgraded site that) and set the paths to the new location in module.config

Example module.config:

<module xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <assemblies>
    <add assembly="Client.Web" />
  </assemblies>
  <clientResources>
    <add name="epi-cms.widgets.base" path="/Static/styles/episerveredit.css" resourceType="Style"/>
    <add name="epi-cms.widgets.base" path="/Static/ClientResources/Scripts/widget/DisplayOptionSelector.js" resourceType="Script" />
    <add name="app.ModuleInitializer" path="/Static/ClientResources/Scripts/ModuleInitializer.js" resourceType="Script" />
    <add name="xx" path="/Static/ClientResources/xx/xx.js" resourceType="Script" />
    <add name="xx" path="/Static/ClientResources/fxx/styles.css" resourceType="Style" />
  </clientResources>
  <clientModule initializer="app.ModuleInitializer">
    <moduleDependencies>
      <add dependency="CMS" type="RunAfter" />
    </moduleDependencies>
  </clientModule>
  <dojo>
    <paths>
      <add name="xx" path="/Static/ClientResources/xx" />
      <add name="app" path="/Static/ClientResources/Scripts" />
    </paths>
  </dojo>
</module>
#311745
Oct 31, 2023 8:26
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.