Copied to clipboard

Flag this post as spam?

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


  • David Peck 650 posts 1764 karma points c-trib
    16 days ago
    David Peck
    0

    Did you always need a query string value for debugging?

    I've been doing my nut in trying to work out why Smidge was bundling my CSS/JS when debugging was turned on. I assumed debugging was turned on because I had set Umbraco:CMS:Hosting:Debug="true" as per the doc..

    However when I checked the UmbracoContext it showed IsDebug == false. Which puzzled me. Looking deeper in to the code it appears that setting this config setting is not sufficient. You must also have a query value of umbdebug=true, umbdebugshowtrace=true or a cookie called UMB-DEBUG set to true. Has this always been the case? I don't recall running in to it before, and this is my first V9 site.

  • Dave Woestenborghs 3413 posts 11575 karma points MVP 6x admin c-trib
    15 days ago
    Dave Woestenborghs
    0

    Hi David,

    I'm not seeing this issue. What do you have in appsettings.Development.json file in the section Umbraco.Cms ? I have the following :

    "Hosting": {
        "Debug": true
      },
      "RuntimeMinification": {
        "useInMemoryCache": true,
        "cacheBuster": "Timestamp"
      }
    

    For production I have this in appsettings.json

    "Hosting": {
        "Debug": false
      },
      "RuntimeMinification": {
        "useInMemoryCache": true,
        "CacheBuster": "AppDomain"
      }
    

    Dave

  • David Peck 650 posts 1764 karma points c-trib
    15 days ago
    David Peck
    100

    There was no issue with my config. However I expected this solely to flag IsDebugMode on, causing Smidge not to bundle for example. However this is not the case. You also need to add a query string (umbdebug) to trigger debug mode.

  • Dave Woestenborghs 3413 posts 11575 karma points MVP 6x admin c-trib
    14 days ago
    Dave Woestenborghs
    0

    Hi David,

    Like I said. Smidge is not bundling for me. I don't need to use the querystring.

    How are using smidge to bundle. Do you create bundles using the runtimeminifier or are using the smidgehelper directly in your views ?

    Dave

  • David Peck 650 posts 1764 karma points c-trib
    14 days ago
    David Peck
    0

    OK. I think I worked it out.

    My confusion came from this code: https://github.com/umbraco/Umbraco-CMS/blob/9326cc5fc64a85e8e7fc19ae7faa726e33c33480/src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs#L121

    I'm calling:

    @await SmidgeHelper.CssHereAsync()
    @await SmidgeHelper.JsHereAsync()
    

    as mentioned in the docs: https://our.umbraco.com/documentation/Fundamentals/Design/Stylesheets-Javascript/

    However I don't think believe that this code accesses IsDebug or IsDebugMode. Instead using IRuntimeMinifier should result in a correct debug status.

Please Sign in or register to post replies

Write your reply to:

Draft