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
    Oct 10, 2023 @ 10:02
    Josefine
    0

    Error when upgrade Umbraco

    I upgrade Umbraco 11.2 to 11.2.1 and it works fine, even to 11.2.2. But when I try to upgrade to 11.3 or to 11.4, 11.5... I get this error (Umbraco has been updated when I start the project but I always get this error when I upgrade a "major" version)

    enter image description here

    I have tried these tips but am getting the same error message. Some tips? https://our.umbraco.com/forum/using-umbraco-and-getting-started/108733-error-when-upgrade-umbraco-9-the-bundle-name-inline-js-bundle-already-exists

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Oct 10, 2023 @ 10:45
    Bjarne Fyrstenborg
    100

    Hi Josefine

    I haven't tested this, but maybe it makes a difference it only run on RuntimeLevel.Run?

    public class Bundle : IComponent
    {
        private readonly IRuntimeState _runtimeState;
        private readonly IRuntimeMinifier _runtimeMinifier;
    
        public Bundle(IRuntimeState runtimeState, IRuntimeMinifier runtimeMinifier)
        {
            _runtimeMinifier = runtimeMinifier;
            _runtimeState = runtimeState;
        }
    
        public void Initialize()
        {
            if (_runtimeState.Level != RuntimeLevel.Run)
            {
                return;
            }
    
            _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>
    { }
    

    It seems if UpgradeUnattended is enabled the Runtime level will use Run instead of Upgrade.

    https://docs.umbraco.com/umbraco-cms/fundamentals/setup/upgrading#boot-order

    For existing projects UpgradeUnattended was opt-in, but it seems this recently has changed, so it will be enabled by default in new projects.

  • Josefine 28 posts 140 karma points
    Oct 11, 2023 @ 09:05
    Josefine
    0

    Hi Bjarne

    Thank you for your reply! Now it works :)

    You made my day! Josefine

Please Sign in or register to post replies

Write your reply to:

Draft