Error when Registering a widget into other module

I tried the following docs for creating a widget and adding it to existing module

In this i’m trying to register a custom widget in order module

        function (mainMenuService, $state, widgetService) {
            //Register module in main menu
            var menuItem = {
                path: "browse/MyLoyalty",
                icon: "fa fa-cube",
                title: "MyLoyalty",
                priority: 100,
                action: function () {
                permission: "MyLoyalty:access",

            var operationLineItemWidget = {
                controller: "MyLoyalty.customerOrderWidgetLineItemController",


Please look in to source of Return modules.
It registered a new widget properly.

Second, check that you added a module dependency on VirtoCommerce.Orders im module.manifest.

vc-module-return/src/VirtoCommerce.ReturnModule.Web/module.manifest at dev · VirtoCommerce/vc-module-return (

Hey even after making changes in module.manifest i get same error

In module I have created a widget which open hello world blade, but while registering a widget I get widgetService is not function

Thank you for the source. We will check and back with comments.

Hey update my function arguments where not same from run dependencies. Thanks for quick response i was able to figure this through return module as it was small module.js. Now i can add widget to any module.

1 Like