U4-10568 - ClientDependency uses "use strict" and it causes some plugins to fail

Created by Kevin Giszewski 19 Oct 2017, 17:24:47 Updated by Kevin Giszewski 08 Dec 2017, 21:20:02

This is more of a caution that a bug.

The current version of ClientDependency (1.9.2) on Cloud core version (7.6.9) appends ''use strict'' in the JS that it creates.

This causes older plugins that may not adhere to strict to fail when setting compilation debug='false'.

Happened on UrlPicker plugin recently but it has been fixed.

Could quite possibly be occurring on other plugins.

1 Attachments


Sebastiaan Janssen 25 Oct 2017, 13:20:45

I checked with @Shandem and CDF doesn't add strict, I could also not find anything in the codebase that would add it. I bet that something in the URL Picker plugin has definded use strict without a semi colon, that would indeed cause a bit of a problem as the minifier then creates something that's invalid.

We've discussed this here before: https://our.umbraco.org/forum/using-umbraco-and-getting-started/79381-all-javascript-is-broken-after-upgrade-to-umbraco-75#comment-253797 and more than a year later, his prediction was correct: he didn't get around to it any time soon.

I'll leave this open as a reminder ;-)

Kevin Giszewski 25 Oct 2017, 13:40:34

Great thx. I'd have to check all the plugins one-by-one to see which one adds that. I don't think URL picker has the 'strict', but it definitely had invalid JS which I fixed.

Anyways, thanks for the reply.

Kevin Giszewski 25 Oct 2017, 14:09:27

And to clear CDF from anything, it seems God Mode uses strict. https://github.com/DanDiplo/Umbraco.GodMode/search?utf8=%E2%9C%93&q=strict&type=

And UrlPicker had a syntax error that is forgiven without strict.

Bleh :)

Priority: Normal

Type: Bug

State: Closed


Difficulty: Normal

Category: Packages

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.9

Due in version:


Story Points: