Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Cannot load Dojo module using module.config

Vote:
 

Hi!

I'm trying to load a Dojo module and my module.config looks like this:

<?xml version="1.0" encoding="utf-8"?>
<module>  	
	<clientModule initializer="Testing/Initializer">
		<moduleDependencies>
			<add dependency="CMS" type="RunAfter" />
		</moduleDependencies>
	</clientModule>
  <dojo>
    <paths>
      <add name="Testing" path="ClientResources/Scripts" />
    </paths>
  </dojo>
</module>

In /ClientResource/Scripts I have a Initializer.js but the error I get is this:

GET http://localhost:6904/EPiServer/Shell/11.36.0/ClientResources/Testing/Initializer.js net::ERR_ABORTED 404 (Not Found)

My is Epi looking for the file under Episerver/Shell... and not under /ClientResources/Scripts?

Thanks!

/Kristoffer

#264509
Oct 05, 2021 14:05
Vote:
 

This is what works for me:

<?xml version="1.0"?>
<module>
  <!-- Define a location for storing dojo modules. The "path" value is relative to the ClientResources physical folder. The "name" value acts as an alias for that location. -->
  <dojoModules>
    <add name="app" path="Scripts" />
  </dojoModules>
</module>

Then if you are using this for something like an editor descriptor, it would look like this:

ClientEditingClass = "app/Editors/MyEditor;

And the path to that dojo module would be at "/ClientResources/Scripts/Editors/MyEditor.js"

#264542
Oct 05, 2021 17:53
Vote:
 

Thanks, that gave me a tip and with this settings it works:

<?xml version="1.0" encoding="utf-8"?>
<module>  	
	<clientModule initializer="Testing/Initializer">
		<moduleDependencies>
			<add dependency="CMS" type="RunAfter" />
		</moduleDependencies>
	</clientModule>
  <dojo>
    <paths>
      <add name="Testing" path="Scripts" />
    </paths>
  </dojo>
</module>

Just removed ClientResources from path. I think I tried that but probably not...

Thanks again!

/Kristoffer

#264619
Oct 06, 2021 7:18
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.