• Resolved logantech

    (@logantech)


    After upgrading to WordPress 5.3 from 5.2, when editing a page using Gutenberg there is now a javascript error in this location:

    http://localhost:8080/mysite/wp-content/themes/primer/assets/js/admin/layouts.min.js?ver=1.8.7

    layouts.min.js?ver=1.8.7:1 Uncaught TypeError: $ is not a function
    at toggleEditorWidth (layouts.min.js?ver=1.8.7:1)
    at HTMLDocument.<anonymous> (layouts.min.js?ver=1.8.7:1)
    at HTMLDocument.dispatch (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:3)
    at HTMLDocument.r.handle (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:3)
    at Object.trigger (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:3)
    at Object.a.event.trigger (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:8)
    at a.fn.init.triggerHandler (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:3)
    at Function.ready (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:2)
    at HTMLDocument.J (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.3:2)

    The error happens in this function, looks like jQuery is not making into the function scope, $(“body.gutenberg-editor-page”) is not instantiated:

    function toggleEditorWidth(e){e=0<=e.indexOf(“wide”)?”wide”:0<=e.indexOf(“narrow”)||0<=e.indexOf(“three-column”)?”narrow”:”default”,$(“body.gutenberg-editor-page”).removeClass(“primer-gutenberg-default primer-gutenberg-wide primer-gutenberg-narrow”).addClass(“primer-gutenberg-“+e)}window.wp=window.wp||{},function(e){e(document).ready(function(){e(‘input[name=”primer-layout-override”]’).change(function(){“1”!==e(this).val()?(e(“.primer-layout ul li”).addClass(“disabled”).find(“:not(.global)”).removeClass(“active”).addClass(“disabled”).find(“input”).prop(“disabled”,!0),e(“.primer-layout ul li.global input”).prop(“checked”,!0).trigger(“change”)):e(“.primer-layout ul li”).removeClass(“disabled”).addClass(“active”).find(“input”).prop(“disabled”,!1)}),e(‘input[name=”primer-layout”]’).change(function(){toggleEditorWidth(e(this).val())})}),e(document).on(“ready”,function(){toggleEditorWidth(primerLayouts.selected)})}(jQuery);

Viewing 1 replies (of 1 total)
  • Theme Author GoDaddy

    (@godaddy)

    We are closing this support request since it is unresolved and has not had any activity for over 1 month. If you are still needing assistance please open a new support request and we will assist you.

    Alternatively, check out our brand new theme Go. Go is an innovative, Gutenberg-first WordPress theme, hyper-focused on empowering makers to build beautifully rich websites with WordPress.

    Thank you!

Viewing 1 replies (of 1 total)

The topic ‘Javascript error in WordPress 5.3 (not 5.2) when editing page (Gutenberg)’ is closed to new replies.