Copied to clipboard

Flag this post as spam?

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


  • Josefine 28 posts 140 karma points
    Apr 06, 2022 @ 17:50
    Josefine
    1

    Error when upgrade Umbraco 9 "The bundle name inline-js-bundle already exists.."

    I use this code for bundling & minification for javascript and css. When I upgrade my Umbraco Version (9.3.1) to 9.4.3 I get this error:

    enter image description here

    using Umbraco.Cms.Core.Composing;
    using Umbraco.Cms.Core.WebAssets;
    
        namespace UmbracoProject.Components
        {
            public class Bundle : IComponent
            {
                private readonly IRuntimeMinifier _runtimeMinifier;
    
                public Bundle(IRuntimeMinifier runtimeMinifier) => _runtimeMinifier = runtimeMinifier;
    
                public void Initialize()
                {
                    _runtimeMinifier.CreateJsBundle("inline-js-bundle",
                        BundlingOptions.NotOptimizedAndComposite,
                        new[] { "~/scripts/myScript1.js", "~/scripts/myScript2.js" });
    
                    _runtimeMinifier.CreateCssBundle("inline-css-bundle",
                        BundlingOptions.NotOptimizedAndComposite,
                        new[] { "~/css/mystylesheet.css" });
                }
    
                public void Terminate() { }
            }
    
            public class MyComposer : ComponentComposer<Bundle>
            { }
        }
    

    Any tips?

    Josefine

  • Hans 4 posts 74 karma points
    May 12, 2022 @ 15:03
    Hans
    0

    I have the same problem when upgrading from 9.3.1 to 9.5

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 12, 2022 @ 15:20
  • Hans 4 posts 74 karma points
    May 13, 2022 @ 05:47
    Hans
    0

    Hi Dave!

    I'm using

      "RuntimeMinification": {
        "UseInMemoryCache": false,
        "CacheBuster": "AppDomain"
      }
    

    and

    "Hosting": {
        "Debug": false
    }
    
  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 13, 2022 @ 06:19
    Dave Woestenborghs
    1

    Hi Hans,

    Could you set useInMemoryCache to true ?

    Dave

  • Hans 4 posts 74 karma points
    May 13, 2022 @ 07:04
    Hans
    0

    Hi Dave,

    Wow now it worked like a charm. No errors during upgrade from 9.3.1 to 9.5.0.

    Thank you very much Dave!

Please Sign in or register to post replies

Write your reply to:

Draft