Skip to content

Commit dd7f1c0

Browse files
Xinyu Zhoulunny
Xinyu Zhou
andauthored
Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734)
fixes: #21733 Uncaught Error: Language id "vs.editor.nullLanguage" is not configured nor known Note that this monaco-editor worked fine on 0.33.0 and broke on 0.34.0. If upstream fixed, remove this code. Signed-off-by: Xinyu Zhou <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent 7e40cee commit dd7f1c0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

web_src/js/bootstrap.js

-3
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

+4
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)