Skip to content

Commit 9bf693d

Browse files
authored
Suppress error from monaco-editor (#29684)
Fixes: #29414 I see no way for us to catch this error, so downgrade it until microsoft/monaco-editor#4325 is fixed, which will likely take a few weeks to propagate up from vscode. The entries in `updates.config.js` will make [`updates`](https://github.com/silverwind/updates) not upgrade these anymore and I think it's good documentation as well to have the reasons why we don't upgrade these dependencies.
1 parent a192a5e commit 9bf693d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

web_src/js/bootstrap.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
// This file must be imported before any lazy-loading is being attempted.
77
__webpack_public_path__ = `${window.config?.assetUrlPrefix ?? '/assets'}/`;
88

9+
const filteredErrors = new Set([
10+
'getModifierState is not a function', // https://github.com/microsoft/monaco-editor/issues/4325
11+
]);
12+
913
export function showGlobalErrorMessage(msg) {
1014
const pageContent = document.querySelector('.page-content');
1115
if (!pageContent) return;
1216

17+
for (const filteredError of filteredErrors) {
18+
if (msg.includes(filteredError)) return;
19+
}
20+
1321
// compact the message to a data attribute to avoid too many duplicated messages
1422
const msgCompact = msg.replace(/\W/g, '').trim();
1523
let msgDiv = pageContent.querySelector(`.js-global-error[data-global-error-msg-compact="${msgCompact}"]`);

0 commit comments

Comments
 (0)