Copied to clipboard

Flag this post as spam?

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


  • Josefine 14 posts 101 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
    15 days ago
    Hans
    0

    I have the same problem when upgrading from 9.3.1 to 9.5

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

    Hi Dave!

    I'm using

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

    and

    "Hosting": {
        "Debug": false
    }
    
  • Dave Woestenborghs 3413 posts 11575 karma points MVP 6x admin c-trib
    14 days ago
    Dave Woestenborghs
    1

    Hi Hans,

    Could you set useInMemoryCache to true ?

    Dave

  • Hans 4 posts 74 karma points
    14 days ago
    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