aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-03-09 18:37:29 +0100
committerGitHub <noreply@github.com>2024-03-09 18:37:29 +0100
commit9bf693d98ddf8efa058a5fbbb6a3da5e0c12ab27 (patch)
tree2cac27dee1ca3f28df4a94c49df2c8f22ed3d335
parenta192a5ed99c2a244d0f015d62088642eb5a81d75 (diff)
downloadgitea-9bf693d98ddf8efa058a5fbbb6a3da5e0c12ab27.tar.gz
gitea-9bf693d98ddf8efa058a5fbbb6a3da5e0c12ab27.zip
Suppress error from monaco-editor (#29684)
Fixes: https://github.com/go-gitea/gitea/issues/29414 I see no way for us to catch this error, so downgrade it until https://github.com/microsoft/monaco-editor/issues/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.
-rw-r--r--web_src/js/bootstrap.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/web_src/js/bootstrap.js b/web_src/js/bootstrap.js
index c0047b0ac2..698d17fa36 100644
--- a/web_src/js/bootstrap.js
+++ b/web_src/js/bootstrap.js
@@ -6,10 +6,18 @@
// This file must be imported before any lazy-loading is being attempted.
__webpack_public_path__ = `${window.config?.assetUrlPrefix ?? '/assets'}/`;
+const filteredErrors = new Set([
+ 'getModifierState is not a function', // https://github.com/microsoft/monaco-editor/issues/4325
+]);
+
export function showGlobalErrorMessage(msg) {
const pageContent = document.querySelector('.page-content');
if (!pageContent) return;
+ for (const filteredError of filteredErrors) {
+ if (msg.includes(filteredError)) return;
+ }
+
// compact the message to a data attribute to avoid too many duplicated messages
const msgCompact = msg.replace(/\W/g, '').trim();
let msgDiv = pageContent.querySelector(`.js-global-error[data-global-error-msg-compact="${msgCompact}"]`);