You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.
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. (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 does not occur under WordPress 5.2.4.
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);
To reproduce:
Log into your WordPress 5.3 site
Pick a page
Click to edit the page
In JavaScript console you'll see the error thrown
The text was updated successfully, but these errors were encountered:
After upgrading to WordPress 5.3 from 5.2.4, when editing a page 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. (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 does not occur under WordPress 5.2.4.
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);
To reproduce:
The text was updated successfully, but these errors were encountered: