page ECharts error - Wrong JSON format #13932

Closed
opened 2026-02-21 19:14:37 -05:00 by yindo · 4 comments
Owner

Originally created by @lsh-boop on GitHub (May 15, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I have a question. I have outputted Echart chart JSON data in a streaming format, and the one currently displayed is suitable for the chart error ECharts error - Wrong JSON format. So, I need to modify where on the frontend page can the icon be displayed during loading What about waiting until the complete JSON is obtained before rendering? please tell me

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @lsh-boop on GitHub (May 15, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I have a question. I have outputted Echart chart JSON data in a streaming format, and the one currently displayed is suitable for the chart error ECharts error - Wrong JSON format. So, I need to modify where on the frontend page can the icon be displayed during loading What about waiting until the complete JSON is obtained before rendering? please tell me ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 19:14:37 -05:00
yindo closed this issue 2026-02-21 19:14:37 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 15, 2025):

I found similar threads that might be helpful for your issue:

  1. In this issue, the solution was to ensure that all keys and string values in the JSON data are wrapped in double quotes. This resolved the 'wrong json error' in a self-hosted Dify environment [1].

  2. Another related issue is here, where the user confirmed that wrapping keys and values in double quotes resolved the rendering exception for ECharts [2].

Regarding your question about displaying a loading icon while waiting for complete JSON data, Dify's frontend handles loading states using conditional rendering. When data is being fetched, if the response is not yet available, it returns a <Loading /> component to indicate the loading state. This approach is used in various chart components, such as MessagesChart, ConversationsChart, and EndUsersChart. You can implement a similar approach by checking the availability of the response data and rendering a loading icon if the data is not yet fetched [3].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (May 15, 2025): <!-- Answer --> I found similar threads that might be helpful for your issue: 1. In [this issue](https://github.com/langgenius/dify/issues/19681), the solution was to ensure that all keys and string values in the JSON data are wrapped in double quotes. This resolved the 'wrong json error' in a self-hosted Dify environment <sup>[[1]](https://github.com/langgenius/dify/issues/19681)</sup>. 2. Another related issue is [here](https://github.com/langgenius/dify/issues/14357), where the user confirmed that wrapping keys and values in double quotes resolved the rendering exception for ECharts <sup>[[2]](https://github.com/langgenius/dify/issues/14357)</sup>. Regarding your question about displaying a loading icon while waiting for complete JSON data, Dify's frontend handles loading states using conditional rendering. When data is being fetched, if the response is not yet available, it returns a `<Loading />` component to indicate the loading state. This approach is used in various chart components, such as `MessagesChart`, `ConversationsChart`, and `EndUsersChart`. You can implement a similar approach by checking the availability of the response data and rendering a loading icon if the data is not yet fetched <sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/app/overview/appChart.tsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8199d7cb-be76-4de8-af3d-597b31aa40a4?feedback_type=other)</sup>
Author
Owner

@lsh-boop commented on GitHub (May 15, 2025):

I found similar threads that might be helpful for your issue:

  1. In this issue, the solution was to ensure that all keys and string values in the JSON data are wrapped in double quotes. This resolved the 'wrong json error' in a self-hosted Dify environment [1].
  2. Another related issue is here, where the user confirmed that wrapping keys and values in double quotes resolved the rendering exception for ECharts [2].

Regarding your question about displaying a loading icon while waiting for complete JSON data, Dify's frontend handles loading states using conditional rendering. When data is being fetched, if the response is not yet available, it returns a <Loading /> component to indicate the loading state. This approach is used in various chart components, such as MessagesChart, ConversationsChart, and EndUsersChart. You can implement a similar approach by checking the availability of the response data and rendering a loading icon if the data is not yet fetched [3].

To continue talking to Dosu, mention @dosu.

I found, how can I modify it to become a chart loading Where are these three words? think you

@lsh-boop commented on GitHub (May 15, 2025): > I found similar threads that might be helpful for your issue: > > 1. In [this issue](https://github.com/langgenius/dify/issues/19681), the solution was to ensure that all keys and string values in the JSON data are wrapped in double quotes. This resolved the 'wrong json error' in a self-hosted Dify environment [[1]](https://github.com/langgenius/dify/issues/19681). > 2. Another related issue is [here](https://github.com/langgenius/dify/issues/14357), where the user confirmed that wrapping keys and values in double quotes resolved the rendering exception for ECharts [[2]](https://github.com/langgenius/dify/issues/14357). > > Regarding your question about displaying a loading icon while waiting for complete JSON data, Dify's frontend handles loading states using conditional rendering. When data is being fetched, if the response is not yet available, it returns a `<Loading />` component to indicate the loading state. This approach is used in various chart components, such as `MessagesChart`, `ConversationsChart`, and `EndUsersChart`. You can implement a similar approach by checking the availability of the response data and rendering a loading icon if the data is not yet fetched [[3]](https://github.com/langgenius/dify/blob/main/web/app/components/app/overview/appChart.tsx). > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ I found<Loading/>, how can I modify it to become a chart loading Where are these three words? think you
Author
Owner

@crazywoola commented on GitHub (May 16, 2025):

This is only for bug report, if you would like to ask a question, please head to Discussions.

@crazywoola commented on GitHub (May 16, 2025): This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
Author
Owner

@lsh-boop commented on GitHub (May 16, 2025):

This is only for bug report, if you would like to ask a question, please head to Discussions.

ok。

@lsh-boop commented on GitHub (May 16, 2025): > This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). ok。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13932