limbo-works / Limbo.Umbraco.ModelsBuilder

Custom models builder for Umbraco.
MIT License
4 stars 3 forks source link

Smidge JS conflict with Umbraco Deploy and Umbraco Forms dashboards #5

Closed hfloyd closed 2 years ago

hfloyd commented 2 years ago

This might only be an issue on sites with Umbraco Deploy/Umbraco Forms installed. I came across it on Umbraco Cloud, where on the live environment the "Deploy" and "Forms" dashboards weren't loading and were throwing Console errors. The Limbo dashboard was loading, but not showing the data.

image

This was the information provided to me by Umbraco Cloud Support:

If you go here - https://[YOURSITE].euwest01.umbraco.io/umbraco#/settings?dashboard=limboModelsBuilder - and open the console you'll see the same error which is also on the workspaces dashboard but this one also refers to the Limbo controller. There seems to be some sort of conflict between the Deploy controller and Limbo controller.

The only way we can explain why the package breaks the workspaces Dashboard only on live is that Deploy doesn't have the same features on the live env that it does on local/dev/stage.

So unfortunately you have hit into this issue https://github.com/Shazwazza/Smidge/issues/132

There's an error in the bundled JS and if you enable debug mode on live then the dashboard with work fine, as the JS isn't bundled anymore which is why it works fine on dev/local

We've enabled debug mode on live and then it worked fine. We've disabled it back again.

The specific Console errors:

umbraco-backoffice-js.js.v637829646180394380:152 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.0/$controller/ctrlreg?p0=UmbracoForms.Dashboards.FormsController
    at umbraco-backoffice-js.js.v637829646180394380:32:168
    at umbraco-backoffice-js.js.v637829646180394380:123:19
    at ea (umbraco-backoffice-js.js.v637829646180394380:105:20)
    at p (umbraco-backoffice-js.js.v637829646180394380:96:476)
    at g (umbraco-backoffice-js.js.v637829646180394380:90:292)
    at umbraco-backoffice-js.js.v637829646180394380:89:422
    at Object.link (umbraco-backoffice-js.js.v637829646180394380:326:432)
    at umbraco-backoffice-js.js.v637829646180394380:42:134
    at Ca (umbraco-backoffice-js.js.v637829646180394380:114:361)
    at p (umbraco-backoffice-js.js.v637829646180394380:98:340) '<div ng-include="property.view">'
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:152
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:124
Ca @ umbraco-backoffice-js.js.v637829646180394380:114
p @ umbraco-backoffice-js.js.v637829646180394380:98
g @ umbraco-backoffice-js.js.v637829646180394380:90
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:89
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:95
d @ umbraco-backoffice-js.js.v637829646180394380:92
m @ umbraco-backoffice-js.js.v637829646180394380:96
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:325
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:165
$digest @ umbraco-backoffice-js.js.v637829646180394380:176
$apply @ umbraco-backoffice-js.js.v637829646180394380:180
k @ umbraco-backoffice-js.js.v637829646180394380:131
v @ umbraco-backoffice-js.js.v637829646180394380:136
y.onload @ umbraco-backoffice-js.js.v637829646180394380:137

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

umbraco-backoffice-js.js.v637829646180394380:152 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.0/$controller/ctrlreg?p0=Limbo.Umbraco.ModelsBuilder.Dashboard.Controller
    at umbraco-backoffice-js.js.v637829646180394380:32:168
    at umbraco-backoffice-js.js.v637829646180394380:123:19
    at ea (umbraco-backoffice-js.js.v637829646180394380:105:20)
    at p (umbraco-backoffice-js.js.v637829646180394380:96:476)
    at g (umbraco-backoffice-js.js.v637829646180394380:90:292)
    at umbraco-backoffice-js.js.v637829646180394380:89:422
    at Object.link (umbraco-backoffice-js.js.v637829646180394380:326:432)
    at umbraco-backoffice-js.js.v637829646180394380:42:134
    at Ca (umbraco-backoffice-js.js.v637829646180394380:114:361)
    at p (umbraco-backoffice-js.js.v637829646180394380:98:340) '<div ng-include="property.view">'
(anonymous) @ umbraco-backoffice-js.js.v637829646180394380:152
umbraco-backoffice-css.css.v637829646180394380:1          Failed to load resource: the server responded with a status of 500 ()

Clicking the related error link https://code.angularjs.org/1.8.0/docs/error/$controller/ctrlreg?p0=Limbo.Umbraco.ModelsBuilder.Dashboard.Controller Shows:

image

I'm not sure if there is something wrong in the Limbo CSS/JS or something in the bundling instructions for those files which is causing an issue...

abjerner commented 2 years ago

@hfloyd thanks for reporting.

Somehow GitHub neglected to send me a notification about this issue, so I've only just seen it now.

It's possible that there is a small syntax error somewhere in my package, which then only is a problem when the JS is minified. I will look into this šŸ˜‰

abjerner commented 2 years ago

By changing the environment of my test site from Development to Production, I can reproduce the issue. I bet it's caused by my attempt at cache busting here:

https://github.com/limbo-works/Limbo.Umbraco.ModelsBuilder/blob/v1/main/src/Limbo.Umbraco.ModelsBuilder/BackOffice/Assets/ModelsBuilderDashboardAsset.cs#L15

I can't remember why I added this. I think Smidge will append the timestamp of the file when running in development mode, and if so, there is no reason for me to also attempting to bust the cache šŸ¤Ŗ

hfloyd commented 2 years ago

Hi Anders! I'm not sure how Smidge is working, but it's possible that Umbraco is not using the bundler at all when debug = true, so little syntax errors aren't becoming apparent in the normal operation of the site. Thanks for looking into this!

abjerner commented 2 years ago

This should now be fixed in v1.0.0-beta006. Thanks for reporting šŸ‘

hfloyd commented 2 years ago

Yay! Fixed āœ”