I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
Expected Behavior:
[Describe what you expected to happen.]
Actual Behavior:
[Describe what actually happened.]
Description
Bug Summary:
marked.lexer works bad in Safari, leading to response un-refresh due to sendPromptOpenAI update the response before the marked.lexer returns. The response refresh is discarded as result.
When rendering a relative long response, Chrome works fine
But safari takes a much longer time to process it
The previous log is printed by modifying src/lib/components/chat/Messages/Markdown.svelte
Steps to Reproduce:
[Outline the steps to reproduce the bug. Be as detailed as possible.]
Logs and Screenshots
Browser Console Logs:
[Include relevant browser console logs, if applicable]
Docker Container Logs:
[Include relevant Docker container logs, if applicable]
Screenshots/Screen Recordings (if applicable):
[Attach any relevant screenshots to help illustrate the issue]
Additional Information
[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Originally created by @zeyugao on GitHub (Nov 18, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7005
## Installation Method
docker for backend, `npm run dev` for frontend
## Environment
- **Open WebUI Version:** https://github.com/open-webui/open-webui/commit/bca9c71ed65dbed0665ffc39f9d4ce8ee3a83b25
- **Ollama (if applicable):** N/A
- **Operating System:** macOS 15.1 (24B83)
- **Browser (if applicable):** Safari 18.1 (20619.2.8.11.10), Chrome 130.0.6723.117
**Confirmation:**
- [ ] I have read and followed all the instructions provided in the README.md.
- [ ] I am on the latest version of both Open WebUI and Ollama.
- [ ] I have included the browser console logs.
- [ ] I have included the Docker container logs.
- [ ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
## Expected Behavior:
[Describe what you expected to happen.]
## Actual Behavior:
[Describe what actually happened.]
## Description
**Bug Summary:**
`marked.lexer` works bad in Safari, leading to response un-refresh due to `sendPromptOpenAI` update the response before the `marked.lexer` returns. The response refresh is discarded as result.
When rendering a relative long response, Chrome works fine

But safari takes a much longer time to process it
<img width="401" alt="image" src="https://github.com/user-attachments/assets/426d3565-7f30-4b02-9901-6b9d345e61cc">
The previous log is printed by modifying `src/lib/components/chat/Messages/Markdown.svelte`
```diff
$: (async () => {
if (content) {
+ const startTime = performance.now();
tokens = marked.lexer(
replaceTokens(processResponseContent(content), model?.name, $user?.name)
);
+ const endTime = performance.now();
+ console.log(`Processing time: ${endTime - startTime} milliseconds`);
}
})();
```
Maybe is it due to the bug of Safari https://github.com/markedjs/marked/issues/2863
So we can only try to do some mitigation to workaround it.
I propose to add a configuration to set the minimal update interval in
https://github.com/open-webui/open-webui/blob/dev/src/lib/components/chat/Chat.svelte#L1701
So that we can wait `marked.lexer` for some time
## Reproduction Details
**Steps to Reproduce:**
[Outline the steps to reproduce the bug. Be as detailed as possible.]
## Logs and Screenshots
**Browser Console Logs:**
[Include relevant browser console logs, if applicable]
**Docker Container Logs:**
[Include relevant Docker container logs, if applicable]
**Screenshots/Screen Recordings (if applicable):**
[Attach any relevant screenshots to help illustrate the issue]
## Additional Information
[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
## Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @zeyugao on GitHub (Nov 18, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7005
Installation Method
docker for backend,
npm run devfor frontendEnvironment
Open WebUI Version: https://github.com/open-webui/open-webui/commit/bca9c71ed65dbed0665ffc39f9d4ce8ee3a83b25
Ollama (if applicable): N/A
Operating System: macOS 15.1 (24B83)
Browser (if applicable): Safari 18.1 (20619.2.8.11.10), Chrome 130.0.6723.117
Confirmation:
Expected Behavior:
[Describe what you expected to happen.]
Actual Behavior:
[Describe what actually happened.]
Description
Bug Summary:
marked.lexerworks bad in Safari, leading to response un-refresh due tosendPromptOpenAIupdate the response before themarked.lexerreturns. The response refresh is discarded as result.When rendering a relative long response, Chrome works fine
But safari takes a much longer time to process it
The previous log is printed by modifying
src/lib/components/chat/Messages/Markdown.svelteMaybe is it due to the bug of Safari https://github.com/markedjs/marked/issues/2863
So we can only try to do some mitigation to workaround it.
I propose to add a configuration to set the minimal update interval in
https://github.com/open-webui/open-webui/blob/dev/src/lib/components/chat/Chat.svelte#L1701
So that we can wait
marked.lexerfor some timeReproduction Details
Steps to Reproduce:
[Outline the steps to reproduce the bug. Be as detailed as possible.]
Logs and Screenshots
Browser Console Logs:
[Include relevant browser console logs, if applicable]
Docker Container Logs:
[Include relevant Docker container logs, if applicable]
Screenshots/Screen Recordings (if applicable):
[Attach any relevant screenshots to help illustrate the issue]
Additional Information
[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!