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 690 posts 1896 karma points c-trib
    May 11, 2022 @ 16:14
    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 3504 posts 12135 karma points MVP 9x admin c-trib
    May 12, 2022 @ 12:23
    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 690 posts 1896 karma points c-trib
    May 12, 2022 @ 21:22
    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 3504 posts 12135 karma points MVP 9x admin c-trib
    May 13, 2022 @ 06:18
    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 690 posts 1896 karma points c-trib
    May 13, 2022 @ 09:54
    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.

  • 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