Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hfloyd opened this issue Mar 15, 2022 · 5 comments
Closed
Assignees
Labels
release/1.0.0-alpha006 type/bug Task is a bug. Fix it please!

Comments

@hfloyd
Copy link
Contributor

hfloyd commented Mar 15, 2022

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 Shazwazza/Smidge#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
Copy link
Member

@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 abjerner added the type/bug Task is a bug. Fix it please! label Mar 18, 2022
@abjerner abjerner self-assigned this Mar 18, 2022
@abjerner
Copy link
Member

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
Copy link
Contributor Author

hfloyd commented Mar 18, 2022

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
Copy link
Member

This should now be fixed in v1.0.0-beta006. Thanks for reporting 👍

@hfloyd
Copy link
Contributor Author

hfloyd commented Mar 30, 2022

Yay! Fixed ✔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/1.0.0-alpha006 type/bug Task is a bug. Fix it please!
Projects
None yet
Development

No branches or pull requests

2 participants