Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug] 模型输出未知html标签会导致页面崩溃,进而丢失数据 #5853

Closed
Ironboxplus opened this issue Feb 7, 2025 · 5 comments · Fixed by #6063
Closed

[Bug] 模型输出未知html标签会导致页面崩溃,进而丢失数据 #5853

Ironboxplus opened this issue Feb 7, 2025 · 5 comments · Fixed by #6063
Labels
🐛 Bug Something isn't working | 缺陷 released

Comments

@Ironboxplus
Copy link

Ironboxplus commented Feb 7, 2025

📦 部署环境

Official Preview

📌 软件版本

1.51.15

💻 系统环境

Windows

🌐 浏览器

Chrome

🐛 问题描述

如题,

Error: Cannot handle unknown node `math`
    at Object.j (4299-6b4778530db9acd7.js:1:60065)
    at Object.o [as handle] (69504-10c95c38366299d1.js:1:216186)
    at O (4299-6b4778530db9acd7.js:1:59811)
    at 97854-c68d8b27bfa64f7d.js:1:47222
    at Array.map (<anonymous>)
    at 97854-c68d8b27bfa64f7d.js:1:47150
    at 57110-0e2a8c85413934e9.js:11:218308
    at node (/html) (https:///_next/static/chunks/57110-0e2a8c85413934e9.js:11:217751)
    at node (/root) (https:///_next/static/chunks/57110-0e2a8c85413934e9.js:11:217971)
    at s (57110-0e2a8c85413934e9.js:11:218048)
    at i (57110-0e2a8c85413934e9.js:11:218229)
    at 97854-c68d8b27bfa64f7d.js:1:46865
    at 57110-0e2a8c85413934e9.js:11:211532
    at i (57110-0e2a8c85413934e9.js:11:211737)
    at n (57110-0e2a8c85413934e9.js:11:211695)
    at i (57110-0e2a8c85413934e9.js:11:211720)
    at 57110-0e2a8c85413934e9.js:11:211660
    at i (57110-0e2a8c85413934e9.js:11:211737)
    at Object.run (57110-0e2a8c85413934e9.js:11:211758)
    at i (57110-0e2a8c85413934e9.js:11:213660)
    at Function.run (57110-0e2a8c85413934e9.js:11:213526)
    at Function.runSync (57110-0e2a8c85413934e9.js:11:213816)
    at en (57110-0e2a8c85413934e9.js:1:21630)
    at ll (11b4783c-ed0e6ee0adaacf7d.js:1:34823)
    at aZ (11b4783c-ed0e6ee0adaacf7d.js:1:61424)
    at ol (11b4783c-ed0e6ee0adaacf7d.js:1:72778)
    at uu (11b4783c-ed0e6ee0adaacf7d.js:1:112194)
    at 11b4783c-ed0e6ee0adaacf7d.js:1:112039
    at ui (11b4783c-ed0e6ee0adaacf7d.js:1:112047)
    at i8 (11b4783c-ed0e6ee0adaacf7d.js:1:109184)
    at uO (11b4783c-ed0e6ee0adaacf7d.js:1:129156)
    at uT (11b4783c-ed0e6ee0adaacf7d.js:1:127585)
    at u_ (11b4783c-ed0e6ee0adaacf7d.js:1:127902)
    at 11b4783c-ed0e6ee0adaacf7d.js:1:127265

第一行的math可能为其他的标签,如mathnode,均为模型可能输出的内容
但是均会导致页面崩溃

其实崩溃了问题不大,主要是lobechat在崩溃的时候会丢数据,此类学术问题普遍较长,有很大概率会出现特殊标签

📷 复现步骤

随机

🚦 期望结果

  1. 可以不渲染,但是别崩溃
  2. 正确处理崩溃逻辑,不要让崩溃页面把模型最新轮的对话挤没了
  3. 此issue

📝 补充信息

No response

@Ironboxplus Ironboxplus added the 🐛 Bug Something isn't working | 缺陷 label Feb 7, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Feb 7, 2025
@lobehubbot
Copy link
Member

👀 @Ironboxplus

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Feb 7, 2025

The issue you're experiencing seems to be related to the handling of unknown nodes like math or mathnode, which are causing the page to crash and potentially leading to data loss. Here are some steps and considerations to address this:

  1. Error Handling: Ensure that the application has robust error handling in place to catch and manage exceptions related to unknown nodes. This can prevent the application from crashing entirely. The ErrorActionsBar component in Lobe Chat is used for handling errors during rendering, which might be a good place to start implementing additional checks for unknown nodes [1].

  2. Data Saving: Implement or enhance the functionality to save conversation data periodically or before rendering potentially problematic content. Lobe Chat has a SaveTopic component that allows saving conversation messages, which can help prevent data loss during crashes [2].

  3. Logging and Debugging: Utilize logging and error reporting tools like Sentry to capture and diagnose these issues. This can help in identifying the exact cause and frequency of the problem [3].

  4. Graceful Degradation: Consider implementing a fallback mechanism where unknown nodes are either ignored or replaced with a placeholder, ensuring that the application continues to function without crashing.

By focusing on these areas, you can improve the application's resilience to such errors and reduce the risk of data loss.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Ironboxplus
Copy link
Author

Image

@Ironboxplus Ironboxplus changed the title [Bug] 模型的输出会导致页面崩溃,进而丢失数据 [Bug] 模型输出未知html标签会导致页面崩溃,进而丢失数据 Feb 8, 2025
@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Feb 13, 2025
@lobehubbot
Copy link
Member

@Ironboxplus

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.53.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🐛 Bug Something isn't working | 缺陷 released
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants