Skip to content

Commit cea7458

Browse files
author
Xinyu Zhou
committed
Quick fixes monaco-editor error: "vs.editor.nullLanguage"
fixes: #21733 Uncaught Error: Language id "vs.editor.nullLanguage" is not configured nor known Signed-off-by: Xinyu Zhou <[email protected]>
1 parent cb83288 commit cea7458

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

web_src/js/bootstrap.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ function processWindowErrorEvent(e) {
2626
return; // ignore such nonsense error event
2727
}
2828

29-
// Wait for upstream fix: https://github.com/microsoft/monaco-editor/issues/2962
30-
if (e.message.includes('Language id "vs.editor.nullLanguage" is not configured nor known')) return;
31-
3229
showGlobalErrorMessage(`JavaScript error: ${e.message} (${e.filename} @ ${e.lineno}:${e.colno}). Open browser console to see more details.`);
3330
}
3431

web_src/js/features/codeeditor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export async function createMonaco(textarea, filename, editorOpts) {
9999
}
100100
});
101101

102+
// Quick fix: https://github.com/microsoft/monaco-editor/issues/2962
103+
monaco.languages.register({id: 'vs.editor.nullLanguage'})
104+
monaco.languages.setLanguageConfiguration('vs.editor.nullLanguage', {})
105+
102106
const editor = monaco.editor.create(container, {
103107
value: textarea.value,
104108
theme: 'gitea',

0 commit comments

Comments
 (0)