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

Component ClientResources Path

Vote:
 

Hello,

I have been banging my head against the wall for a while now trying to figure out what I am doing wrong here. I am trying to package my dashboard component, but when I try to reference the dojo script, it throws a 404 because it is looking in the ~/Episerver/Shell/{version}/ folder instead of my packaged component folder. Looking at the component package it all seems to be structured correctly in ~/modules/_protected/{package_name}. I am assuming its something I am doing wrong with my module.config but I can't seem to narrow it down.

<?xml version="1.0" encoding="utf-8"?>
<module productName="componentName" clientResourceRelativePath="1.0.9" loadFromBin="false" tags="EPiServerModulePackage">
  <assemblies>
    <add assembly="company.componentName" />
  </assemblies>

  <dojo>
    <paths>
      <add name="componentName" path="ClientResources/Scripts" />
    </paths>
  </dojo>

  <clientModule>
    <moduleDependencies>
      <add dependency="Shell" />
      <add dependency="CMS" />
    </moduleDependencies>
  </clientModule>
</module>

Can anyone point me in the right direction?

Thanks

#203921
May 10, 2019 21:25
Vote:
 

I think you may need to define your resources in a clientResources node in the module.config - https://world.episerver.com/documentation/developer-guides/CMS/configuration/Configuring-moduleconfig/#clientResources

#203944
May 13, 2019 17:22
Vote:
 

Hi David,

Did you figure this out? I'm interested because I noticed somebody found a bug on a package I created a while back that looks exactly like this (https://github.com/jacobjones/DoubleJay.Epi.ConfigurableColorPicker/issues/1). Haven't dug into it, but I tested in Episerver 10 and 11 before I released itso kinda strange.

#203946
May 14, 2019 0:55
Vote:
 

Hey Jake,

I did find out what it was. Having it in the _protected folder, I forgot to make sure autodiscovery for <protectedModules> in the web.config was set to Modules. So it was never scanning it for my component. I found another post about it here. Not sure if thats the issue you were having, but it resolved it for me.

Thanks

#204152
May 21, 2019 1:32
Vote:
 

I was looking into a similiar issue in an upgraded project where EPiServer.Forms didn't run correctly after installing. Got 404 errors from a couple of JS references and some more problems.

I removed all traces of EPiServer.Packaging and also found this config pointing to the old Modules setup.

<add virtualPath="~/EPiServer/"
physicalPath="[appDataPath]\Modules"
customFileSummary="~/FileSummary.config"
name="ProtectedAddons"
type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework.AspNet" />

Replaced it with:

<add name="ProtectedModules" virtualPath="~/EPiServer/" physicalPath="Modules\_Protected" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework.AspNet" />

#206917
Sep 04, 2019 7:53
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.