Try our conversational search powered by Generative AI!

404 error / blank edit mode - Dojo class is missing after deployment to Integration (DXP hosting), locally works


I've implemented an editor descriptor and created dojo class: CustomLinkItemModel.js. Locally everything works, but after deployment to Integration, an edit mode is blank for this block and I've noticed this error in the console: GET 404. I've also noticed that this js file wasn't be added to relaese package before hosting on DXP.

1) The module.config is located in the root directory (projectName.web) and looks like this:

2) Files structure:

3) The editor descriptor includes a following line:
 ItemModelType = "projectName/CustomLinkItemModel"

4) The CustomLinkItemModel.js looks like this:

Anybody knows what might be wrong or maybe what is missing?

Edited, Jan 10, 2023 21:38

This could be caused by case-sensitive URL processing in Linux environment.

Add RouteOptions to Startup.cs:

services.Configure(o => { o.LowercaseUrls = true; });


Jan 11, 2023 0:23
Aneta Petryla - Jan 11, 2023 8:51
It didn't help ;) I've noticed that this file wasn't appended to release package after building in Azure DevOps, maybe structure with ClientResource dictionary is wrong (module.config is included)?

Any other option why it doesn't exist in the build package (maybe it is the reason of 404 error)? Because locally I have correct structure of ClientResources and the script exists

Jan 11, 2023 13:27

@Aneta, in our solution we hold these resources within the wwwroot i.e. 

Our module.config looks like this 

<?xml version="1.0" encoding="utf-8"?>
<module clientResourceRelativePath="2.0" loadFromBin="false">
    <!-- The assembly containing the rest store needs to be added. -->
    <add assembly="Redacted.Cms" />
    <route url="{moduleArea}/{controller}/{action}/">
        <add key="moduleArea" value="Redacted.Cms" />
        <add key="controller" value="" />
        <add key="action" value="Index" />
      <add name="Redacted" path="~/ClientResources/Scripts" />
  <clientModule initializer="Redacted/ModuleInitializer">
      <add dependency="Shell" />
      <add dependency="CMS" type="RunAfter" />
    <!-- Inject our custom Display Option selector -->
    <add name="epi-cms.widgets.base" path="~/ClientResources/Scripts/widget/DisplayOptionSelector.js" resourceType="Script"/>

And in Project file have the following 

    <Content Update="module.config">

Would be worth checking the 3 things over in your solution 

Edited, Jan 11, 2023 13:37
Aneta Petryla - Jan 11, 2023 13:42
I've just done it: moving it under wwwroot and now I'm waiting for build (probably it should help). Come back with answer :)
Minesh Shah (Netcel) - Jan 11, 2023 13:45
@Aneta Petryla
Ensure you also have the CopyToOutputDirectory set to Always as well in your project file
Aneta Petryla - Jan 11, 2023 15:05
Ok, and what is ModuleInitializer.js, is it needed also to every sojo script run correctly?
Minesh Shah (Netcel) - Jan 11, 2023 15:57
I don't believe you will need this, it was specifically for registering the display option rest store
Aneta Petryla - Jan 11, 2023 21:51
I've needed to restart the app on Integration. Everything is working now! Only moving ClientResources under wwwroot has helped :) Thanks a lot
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.