mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[GH-ISSUE #18277] issue: Mermaid code blocks containing syntax errors will cause the page to crash and become unusable #138277
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ShirasawaSama on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18277
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.6.33 & dev
Ollama Version (if applicable)
No response
Operating System
MacOS 26
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The page has no rendering errors.
Actual Behavior
The entire page rendered incorrectly and became completely unusable.
Steps to Reproduce
Logs & Screenshots
Additional Information
No response
@silentoplayz commented on GitHub (Oct 13, 2025):
You're not going to get that with a model that can't generate a Mermaid code block successfully. I got many MermaidJS syntax related errors from models generating incorrect Mermaid code blocks, but not the particular issue that you've pointed out in this thread. It's too hit or miss.
@rgaricano commented on GitHub (Oct 13, 2025):
The issue can be for an infinite loop of the reactive component, that block the execution on error.
But
onUpdate(token)at the start ofrender()may be triggering parent component updates.This causes the reactive statement
$: if (_token) { render(); }to fire again CodeBlock.svelte creating an infinite error loop that freezes the browser.Workaround:
Move
onUpdate(token)to after the rendering attempt & add a guard to prevent re-rendering on the same token:src/lib/components/chat/Messages/CodeBlock.svelte#L326-L350
I didn't try it!
If this fix it and is PRed: keep the vega part, it have the same situation (this fix is for both renderers) & please, add also error catching with re-throwing (to display it on toast) in the utility function layer for more control of both :
src/lib/utils/index.ts#L1596-L1622
@rgaricano commented on GitHub (Oct 13, 2025):
I edited the vega utility function, I had pasted it with an unused i18n parameter (remanent from first implementation)
@tjbck commented on GitHub (Oct 14, 2025):
How do we reproduce this? Was this recently introduced with a refac?