Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1465 posts 1887 karma points
    Sep 30, 2019 @ 12:37
    Gordon Saxby
    0

    Strict mode code may not include a with statement

    I am unable to install this package on our live site as I get this error (title of post).

    However, it installed OK locally and on our Dev and Staging servers!?

    I have seen this post https://our.umbraco.com/packages/backoffice-extensions/newsletter-studio/comments/89712-strict-mode-code-may-not-include-a-with-statement-error-with-client-dependency-on - I tried removing the "strict" statement and I tried wrapping the code in a function but none of that worked.

    Are you able to revise the files (or show me how to) like you did for your GodMode package?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Sep 30, 2019 @ 15:52
    Dan Diplo
    0

    Releasing a new version takes a fair bit of time, so quickest solution would be to go the /App_Plugins/DiploTraceLogViewer/backoffice/diplotracelog/ folder and locate the following JS files:

    Diplo.TraceLog.Controller.js
    Diplo.TraceLog.Detail.Controller.js 
    Diplo.TraceLog.Resources.js
    

    Then wrap them in a function like this:

    (function () {
    ....
    })();
    

    For an example, see how it is done in GodMode:

    https://github.com/DanDiplo/Umbraco.GodMode/blob/master/Umbraco.Web/App_Plugins/DiploGodMode/BackOffice/Scripts/GodMode.ContentBrowser.Controller.js

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies