Try our conversational search powered by Generative AI!

dojo Menu plugin not working...


I'm creating a custom toolbar button usng Dojo as described here: I'm fairly sure I've got everything wired up correctly, but when I start the site and enter edit mode, I get the following error:

Unhandled exception at line 2, column 1738 in http://jrcms7mvc/epi/Shell/

0x800a139e - JavaScript runtime error: Could not resolve dependency "epi.globalcommandregistry" (epi.dependency)

The code for my button registration module, WorkflowCommands.js in the folder ClientResources/Scripts/widgets/widgetlib is as follows:

], function 
    ) {

    var handle,
        registry = dependency.resolve('epi.globalcommandregistry'),
        callback = function (identifier, provider) {
            if (identifier !== "epi.cms.globalToolbar") {
            provider.addCommand(new WorkflowUpdateCommand(), { showLabel: true, id: "WorkflowUpdateCommand", disabled: true }); // Disabled until we navigate to relevant content

    handle = aspect.after(registry, 'registerProvider', callback, true);

My module.config file (in the website root) looks like this:


I think I need to register a dependency on the Shell module, but I'm not sure how - anyone got any ideas?

Thanks in advance,


Aug 07, 2014 14:58

Hello Mark,

Did you find the issue? I have the same problem.



Oct 29, 2014 22:51

I would guess that your module is loading before the EPiServer module has loaded (as mentioned in the comments to Ted's post). Add the following to your module.config

        <add dependency="Shell" />
        <add dependency="CMS" />
Nov 05, 2014 13:04


I added the <clientModule> section to the module.config file in the site root, but still get the same issue.

Should I be adding the section to a module.config file in the same folder as my WorkflowCommands.js file?

I raised issue DI-142857 on October 6th for this, and uploaded a test case, but haven't heard anything since, despite repeated reminders.

Nov 05, 2014 14:00

It seems odd to me that you would have two module.config files but in any case it should be in the one that is loading the JavaScript stuff. The idea being that you want to delay loading and running your JavaScript till the EPiServer module has loaded.

Also you would probably get away with only having a dependency on Shell. So you can probably remove the line with the CMS dependency in the code I posted previously.

And finally I'm not part of the support team so I can't help you with the support case. I just happened to be browsing the forums ;) I have pinged them however and hopefully they pick this up.

Nov 05, 2014 14:11

Thanks for that Ben,

I'm sure I've misconfigured something, but haven't been able to work out what.

Hopefully Developer Support will get back to me with what I've done wrong.

Nov 05, 2014 14:18

Developer Support put me right on this: the 'define([' on line 1 of the WorkflowCommands.js should be 'require(['

Dec 03, 2014 15:37

You are correct.

Dec 03, 2014 15:44

I've upgraded to 7.19 and getting the same error, have changed define to require and added shell to module.config, still same error is throwed. Any more ideas?

Feb 16, 2015 11:44

After the upgrade to 7.19.2 and EPiServer.CMS.UI to 7.18.0 this stopped working. I am getting the error

"Error: Could not resolve dependency "epi.globalcommandregistry" (epi.dependency)" Any ideas?

May 13, 2015 16:38

The "epi.globalcommandregistry" dependency is setup in the initialization of our Shell module. If you can not resolve the dependency then your code must be running before the Shell module is initialized. If you run in debug mode then I believe we log the module initialiation to the console. This would be the best place to start debugging.

Also if you are using the above hack then I recommend you rewrite you code to use a module initializer and the initializer attribute in the module config that was added in 7.5

May 19, 2015 10: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.