go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.98k stars 5.48k forks source link

Mermaid code blocks in markdown showing error #21427

Closed dvjn closed 2 years ago

dvjn commented 2 years ago

Description

When I create a mermaid code block in a markdown file, error banners are shown on each character input. Also, in the preview tab, the height of the mermaid diagram is broken.

This is working properly on v1.17 but breaking on dev.

Stacktrace:

22:32:03.497 Uncaught Error: Language id "vs.editor.nullLanguage" is not configured nor known

F@https://try.gitea.io/assets/js/monaco.943e8892.js:135:7465
getLanguageConfiguration@https://try.gitea.io/assets/js/monaco.943e8892.js:135:7221
getLanguageConfiguration@https://try.gitea.io/assets/js/monaco.943e8892.js:154:21355
getWordAtPosition@https://try.gitea.io/assets/js/monaco.943e8892.js:154:21664
getWordAtPosition@https://try.gitea.io/assets/js/monaco.943e8892.js:163:10576
Ue@https://try.gitea.io/assets/js/monaco.943e8892.js:251:5156
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/rt/<@https://try.gitea.io/assets/js/monaco.943e8892.js:251:3900
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/X/<@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6704
X@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6467
rt@https://try.gitea.io/assets/js/monaco.943e8892.js:251:3856
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/update/</Kt</<@https://try.gitea.io/assets/js/monaco.943e8892.js:251:525
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/X/<@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6704
X@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6467
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/update/</Kt<@https://try.gitea.io/assets/js/monaco.943e8892.js:251:473
T@https://try.gitea.io/assets/js/monaco.943e8892.js:28:79091
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/update/<@https://try.gitea.io/assets/js/monaco.943e8892.js:251:467
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/X/<@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6704
X@https://try.gitea.io/assets/js/monaco.943e8892.js:250:6467
update@https://try.gitea.io/assets/js/monaco.943e8892.js:251:345
./node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.contribution.js/ve/this.updateSoon<@https://try.gitea.io/assets/js/monaco.943e8892.js:250:10076
doRun@https://try.gitea.io/assets/js/monaco.943e8892.js:28:83100
onTimeout@https://try.gitea.io/assets/js/monaco.943e8892.js:28:83040
    unexpectedErrorHandler https://try.gitea.io/assets/js/monaco.943e8892.js:30
monaco.943e8892.js:30:12

Gitea Version

dev

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image image image

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker Image: gitea/gitea:dev

Database

SQLite

silverwind commented 2 years ago

Seems this is a bug introduced in Monaco 0.34: https://github.com/microsoft/monaco-editor/issues/2962.

I don't think we can do anything about it until it's fixed upstream, at best, we could filter out this specific error message or downgrade Monaco.