Unable to use after upgrade
See original GitHub issueDescribe the bug
After upgrading from an old version, I can’t use it normally. An error is reported
Uncaught TypeError: pluginInfo is undefined node_modules toast-ui/editor/dist/toastui-editor.js:3841 node_modules toast-ui/editor/dist/toastui-editor.js:3837 node_modules toast-ui/editor/dist/toastui-editor.js:27771 <anonymous> http://localhost/wp-content/plugins/WP-ReliableMD/js/WPReliableMD_Admin.js?ver=1.0:417 jQuery 2 toastui-editor.js:3841:22 getPluginInfo http://localhost/wp-content/plugins/WP-ReliableMD/node_modules/@toast-ui/editor/dist/toastui-editor.js:3841 reduce self-hosted:276 getPluginInfo http://localhost/wp-content/plugins/WP-ReliableMD/node_modules/@toast-ui/editor/dist/toastui-editor.js:3837 ToastUIEditor http://localhost/wp-content/plugins/WP-ReliableMD/node_modules/@toast-ui/editor/dist/toastui-editor.js:27771 <anonymous> http://localhost/wp-content/plugins/WP-ReliableMD/js/WPReliableMD_Admin.js?ver=1.0:417 jQuery 2
To Reproduce
Use the following code:
// Start the main app logic.
//requirejs(['jquery', 'tui-editor', 'editor-mathsupport', 'htmlToText', 'MarkdowConvertor'], function ($, Editor, mathsupport, htmlToText, MarkdowConvertor) {
//requirejs(['jquery', 'tui-editor', 'tui-chart', 'tui-code-syntax-highlight', 'tui-color-syntax', 'tui-table-merged-cell', 'tui-uml', 'htmlToText', 'MarkdowConvertor', 'editor-mathsupport', 'tui-mathsupport'], function ($, Editor, chart, codeSyntaxHighlight, colorSyntax, TableMergedCell, Uml, htmlToText, MarkdowConvertor, mathsupport, viewerMathsupport) {
requirejs(
[
'jquery',
'tui-editor',
'tui-chart',
'tui-code-syntax-highlight',
'tui-color-syntax',
'tui-table-merged-cell',
'tui-uml',
'htmlToText',
'editor-mathsupport',
'tui-mathsupport',
],
function (
$,
Editor,
chart,
codeSyntaxHighlight,
colorSyntax,
TableMergedCell,
Uml,
htmlToText,
mathsupport,
viewerMathsupport
) {
var $_GET = (function () {
var url = window.document.location.href.toString();
var u = url.split('?');
if (typeof u[1] === 'string') {
u = u[1].split('&');
var get = {};
for (var i in u) {
var j = u[i].split('=');
get[j[0]] = j[1];
}
return get;
} else {
return {};
}
})();
var initsatus = {
result: true,
};
$(document).ready(function () {
var editor;
var content = '';
var post_id = ReliableMD.post_id;
if (typeof $_GET['post'] !== 'undefined') {
content = '';
$.get(ReliableMD.api_root + 'wp/v2/posts/' + post_id, function (apost) {
console.log(apost);
var raw_md = apost.markdown
? apost.content.markdown
: htmlToText(apost.content.rendered);
content = ['# ' + apost.title.rendered, raw_md].join('\n');
editor.setMarkdown(content);
});
} else {
content = '# Your title here';
}
var post = function (draft_button = true) {
var raw = editor.getMarkdown();
var title = 'no title';
if (raw.indexOf('#') === 0) {
raw.replace(/^# *(.+)/, function (s, value) {
title = value;
});
raw = raw.split('\n').slice(1).join('\n');
}
var post_status;
var data = {
title: title,
content: raw,
markdown: true,
};
if (data !== false) {
$.ajax({
url: ReliableMD.api_root + 'wp/v2/posts/' + post_id,
//url: ReliableMD.root + 'WPReliableMD/posts/' + post_id,
method: 'POST',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-WP-Nonce', ReliableMD.nonce);
},
data: data,
}).done(function (response) {
console.log(response);
post_id = response.id;
alert('Posted passage:' + data.status);
});
return true;
} else {
console.warn(
'Illegal call, callback function chain call failed, may be parameter error!'
);
return false;
}
};
window.tagBox.init();
const chartOptions = {
minWidth: 100,
maxWidth: 600,
minHeight: 100,
maxHeight: 300,
};
editor = new Editor({
el: document.querySelector('#editSection'),
previewStyle: 'vertical',
height: '600px',
initialEditType: 'markdown',
useCommandShortcut: true,
initialValue: content,
plugins: [
[chart, chartOptions],
codeSyntaxHighlight,
TableMergedCell,
Uml,
mathsupport,
],
//customConvertor: MarkdowConvertor
});
console.log(editor.preview.eventManager);
//editor.preview.eventManager.listen('convertorAfterMarkdownToHtmlConverted', viewerMathsupport.viewerRender)
editor.preview.eventManager.listen(
'previewRenderAfter',
viewerMathsupport.previewRender
);
});
}
);
Screenshots

Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
@seonim-ryu The problem has been solved. There is a problem with one of my plug-ins, which returned undefined. But I think there is still room for improvement in error handling in Tui. Can I stop loading plug-ins and report an error or warning when there is an error when loading some plug-ins
@jack9603301 Then, solving the loading problem will also solve the issue? I’m not sure I understood what you said. 🤔