Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Jun 01, 2021 @ 11:45
    Mario Lopez
    0

    Script not included in umbraco-backoffice-extensions-js

    I am trying to use a js library into a new dashboard. This is how I'm including the files:

    {
     "javascript": [
          "/App_Plugins/uDashboard/webix/webix/codebase/webix.js",
          "/App_Plugins/uDashboard/webix/webix-angularjs.js",
          "/App_Plugins/uDashboard/js/dashboard.controller.js",
          "/App_Plugins/uDashboard/js/dashboard.services.js"
     ],
     "css": [ "/App_Plugins/uDashboard/webix/webix/codebase/webix.min.css"] 
    }
    

    The problem I have is that the script on the 'webix-angularjs.js' file complains because 'webix' is not defined. Webix is defined in the file before 'webix.js'.

    I can see that these files are concatenated by Umbraco in a custom file called 'umbraco-backoffice-extensions-js.js'.

    If I inspect that file, I can see that the content of webix.js is not there, but it includes the rest of my js: webix-angularjs.js, dashboard.controller.js and dashboard.services.js

    If I type 'webix' on the Dev console I can in fact see that webix is not defined.

    For some reason, the file is not being loaded by Umbraco.

    EDIT

    The content of webix-angularjs.js is here

    The content of webix.js is here

  • Viktor 7 posts 78 karma points
    Feb 17, 2022 @ 10:01
    Viktor
    0

    Hi!

    Have you found a solution to this issue?

    We have the same problem on our server when trying to get Contentment to work. If I change Debug to true in the server appsettings-file it works:

    "Umbraco": {
      "CMS": {
        "Hosting": {
          "Debug": false //If I change this to "true" it works
        }
      }
    }
    

    But we want to keep it as Debug=false in that environment.

    The file /sb/umbraco-backoffice-extensions-js.js.vc4856266498544f87708fd9d70704dc3b759536d does not contain any referense to Contentment.

    In our development environment (where it works) it looks like this in umbraco-backoffice-extensions-js when i change Debug to false:

    angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors.Buttons.Controller",["$sco...
    

    I was hoping to find an answer to this issue, I hope you can help me.

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Feb 20, 2022 @ 21:59
    Mario Lopez
    1

    Hi Viktor,

    There's an issue open on Github about this: https://github.com/umbraco/Umbraco-CMS/issues/10372

    It looks like it hasn't been fixed yet.

  • Paul 184 posts 646 karma points
    Jun 29, 2022 @ 10:53
    Paul
    0

    Still nothing in terms of a fix yet unfortunately.

  • Viktor 7 posts 78 karma points
    Feb 21, 2022 @ 07:38
    Viktor
    0

    Thank you! I will place a comment on that issue.

  • Alexander Tkacuk 19 posts 120 karma points
    Feb 21, 2022 @ 13:21
    Alexander Tkacuk
    0

    Hey,

    looks like after minimalizing JS angular cant resolve dependencies.

    try to change:

    angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors.Buttons.Controller",["$sco...
    

    to

    (function () {
    "use strict";
    angular.module("umbraco").controller("Umbraco.Community.Contentment.Tree.Controller", controller);
    controller.$inject = ["$scope", navigationService]
    function controller ($scope, navigationService){ <here paste controller content> }})();
    
  • Viktor 7 posts 78 karma points
    May 09, 2022 @ 11:26
    Viktor
    1

    Hi. I am not sure if this is the fix but I got a similar issue when working with UmbracoForms. (Error: $controller:ctrlreg") I fixed this on the server by deleting the "/Smidge"-folder. It contained old cache-files that did not include the new added plugin. After deleting that folder and after a page reload, Umbraco generated new cache-files, containing the new plugin. And now UmbracoForms works great!

  • Somaiyeh Taheri 2 posts 73 karma points
    Jun 06, 2022 @ 08:13
    Somaiyeh Taheri
    1

    thanks for your solution it worked for me too.

Please Sign in or register to post replies

Write your reply to:

Draft