Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fixes monaco-editor error: "vs.editor.nullLanguage" #21734

Merged
merged 3 commits into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions web_src/js/bootstrap.js
Expand Up @@ -26,9 +26,6 @@ function processWindowErrorEvent(e) {
return; // ignore such nonsense error event
}

// Wait for upstream fix: https://github.com/microsoft/monaco-editor/issues/2962
if (e.message.includes('Language id "vs.editor.nullLanguage" is not configured nor known')) return;

showGlobalErrorMessage(`JavaScript error: ${e.message} (${e.filename} @ ${e.lineno}:${e.colno}). Open browser console to see more details.`);
}

Expand Down
4 changes: 4 additions & 0 deletions web_src/js/features/codeeditor.js
Expand Up @@ -99,6 +99,10 @@ export async function createMonaco(textarea, filename, editorOpts) {
}
});

// Quick fix: https://github.com/microsoft/monaco-editor/issues/2962
monaco.languages.register({id: 'vs.editor.nullLanguage'});
monaco.languages.setLanguageConfiguration('vs.editor.nullLanguage', {});

const editor = monaco.editor.create(container, {
value: textarea.value,
theme: 'gitea',
Expand Down