"Uncaught ReferenceError: Editor is not defined" after upgrading from Editor 2.1.3 to 2.2
"Uncaught ReferenceError: Editor is not defined" after upgrading from Editor 2.1.3 to 2.2
Loren Maxwell
Posts: 387Questions: 94Answers: 10
I just upgraded from Editor 2.1.3 to 2.2.0 and get the following error in the console on every page the Editor is included:
Uncaught ReferenceError: Editor is not defined
at editor.bootstrap5.min.js:4:3936
at editor.bootstrap5.min.js:4:509
at editor.bootstrap5.min.js:4:535
Here's the offending code in editor.bootstrap5.min.js:
/*! Bootstrap integration for DataTables' Editor
* © SpryMedia Ltd - datatables.net/license
*/
! function(o) {
// blah blah blah //
}(function(l, t, s, e) {
"use strict";
var r = l.fn.dataTable;
// blah blah blah //
return r.Editor.bootstrap = function(t) {
// blah blah blah //
}), Editor <<<--- *****!!! HERE !!!*****
});
Everything seems to work, but after a brief look through the code I'm wondering if that's not meant to be r.Editor
?
I changed it in my local file and everything still seems to work and the error went away.
This question has accepted answers - jump to:
Answers
Sorry! I'm going to do a 2.2.1 release with the fix for this tomorrow. As a workaround with the file that give throwing the error do
r.Editor
rather than justEditor
.Allan
You could grab the contents of this file to replace the
editor.bootstrap5.min.js
that you have. The one on our site has the fix applied.Allan
Thanks, @allan!
I think this happens with jqueryui as well.
I upgraded to DT 2.1.5 and Editor 2.2.0 and go the same error messages, but reverting datatables.min.js to 2.1.2 and dataTables.editor.js and editor.jqueryui.js to 2.1.2 seems to have solved the problem.
Yes, all of the styling extensions will have exactly the same error in the UMD. Sorry! It was the script that wraps them into ESM and UMD that had the issue.
I think we are getting close to being able to do the next release.
Allan