Copied to clipboard

Flag this post as spam?

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


  • Tito 314 posts 623 karma points
    Dec 01, 2021 @ 09:16
    Tito
    0

    Umbraco 9 cant find controller for my Block list editor custom view after deploy

    I am using Umbraco 9.1.1

    I have created a custom view in my App_Plugins folder for a block. The view uses a controller, in a js file that is linked in my manifest file:

    {   
    javascript: [
        '/App_Plugins/Blocks/Component/controller.js?v=2'
    ]
    

    }

    It works great in localhost but after deploy to azure app the custom view is not rendering. In console i can see this error:

    umbraco-backoffice-js.js.v1:152 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.0/$controller/ctrlreg?p0=MyProject.Blocks.ComponentController
    at umbraco-backoffice-js.js.v1:32
    at umbraco-backoffice-js.js.v1:123
    at ea (umbraco-backoffice-js.js.v1:105)
    at p (umbraco-backoffice-js.js.v1:96)
    at g (umbraco-backoffice-js.js.v1:90)
    at umbraco-backoffice-js.js.v1:89
    at Object.link (umbraco-backoffice-js.js.v1:326)
    at umbraco-backoffice-js.js.v1:42
    at Ca (umbraco-backoffice-js.js.v1:114)
    at p (umbraco-backoffice-js.js.v1:98) `<div class="umb-block-list__block--view" ng-include="'/App_Plugins/Blocks/Component/control.html'">`
    

    It seems the controller is not registering. I have tried restarting the web app, increasing version of smidge in appsettings.json:

    "RuntimeMinification": {
          "CacheBuster": "Version",
          "version": "2"
        }
    

    Still does not work :(

  • Tito 314 posts 623 karma points
    Dec 01, 2021 @ 16:39
    Tito
    100

    I solved the problem it was the ?v=2 in the manifest file:

    /App_Plugins/Blocks/Component/controller.js?v=2
    

    In v7 and v8 i used this to refresh the cache but in v9 it gets an error loading the file

Please Sign in or register to post replies

Write your reply to:

Draft