- Issue created by @jglynn
With Drupal 8.9, I get the following console JS error on all pages when aggregation is turned on:
" Uncaught ReferenceError: once is not defined"
This error blocks all other JS execution on the page. No error when aggregation is turned off. Only workaround I've found is to uninstall the module.
The error is with the last line of the following code:
// ---- Some event handlers for CKEditor ----.
function keydown(e) {
if ((e.data.$.keyCode === 83) && (e.data.$.ctrlKey || e.data.$.metaKey)) {
e.data.preventDefault();
clickOnSubmitButton();
}
}
function keyup(e) {
if (e.data.$.keyCode === 83) {
clickAllowed = true;
}
}
function contentDom(e) {
let editable = e.editor.editable();
editable.attachListener(editable, 'keydown', keydown);
editable.attachListener(editable, 'keyup', keyup);
}
function instanceCreated(e) {
e.editor.on('contentDom', contentDom);
}
// If CKEditor is present on the page then also attach keyboard events
// listeners to it. Because if it gains focus then the document will not
// capture the events.
if (window.CKEDITOR) {
window.CKEDITOR.on('instanceCreated', instanceCreated);
}
}
};
}
)(Drupal, once);
Active
2.0
Code