'Angular controller errors with Umbraco 9 plugins when deployed to Azure App Service

It seems every time I try and deploy a plugin to Umbraco 9 on Azure App Service I seem to end up with an Angular error where the plugin's controllers don't get registered something like this

Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.0/$controller/ctrlreg?p0=Our.Iconic.Prevalues.Packages
    at umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:32:168
    at umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:123:19
    at ea (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:105:20)
    at p (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:96:476)
    at g (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:90:292)
    at umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:89:422
    at Object.link (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:326:432)
    at umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:42:134
    at Ca (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:114:361)
    at p (umbraco-backoffice-js.js.vd671f7279661e0e87e3549a36c6c11bb1054da05:98:340) '<div ng-include="propertyEditorView">'

When you click on that angular link it just says

The controller with the name 'Our.Iconic.Prevalues.Packages' is not registered.

Everything works perfectly fine on my local environment and when I connect to the Azure App Service all the files are there in the App_Plugins... folder. It even loads some of the other files in the manifest but for some reason the controllers don't get registered. This is not the first plugin where this has happened either. Last time I manually deleted / copied files / redeployed / restarted / stood on one foot and eventually it started working. No idea what fixed it. Now next package added same thing happens again. What am I missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source