langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
45.7k stars 6.43k forks source link

Minified React error #31 - Application error: a client-side exception has occurred #7793

Closed danialcheung closed 2 weeks ago

danialcheung commented 2 weeks ago

Self Checks

Dify version

0.7.1, 0.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Application error: a client-side exception has occurred shows up after an LLM has given its reply to a user. This occurs during a workflow preview, as well as at the 'explore' section. Frequency is undetermined as sometimes it will take a few messages for it to show an error, whereas other times it will output an error instantly after the first message has been replied to.

Upgraded from 0.7.1 to 0.7.2 and the error persists. image

✔️ Expected Behavior

An error to not occur.

❌ Actual Behavior

Application error: a client-side exception has occurred caused by Minified React error #31.

dosubot[bot] commented 2 weeks ago

Hello @danialcheung! I'm here to help you with any bugs, questions, or contributions you may have for the Dify repository. Feel free to ask for assistance while we wait for a human maintainer.

I found some relevant information that might help address the issue you're encountering.

Similar Issues and Discussions

  1. Application error: a client-side exception has occurred (see the browser console for more information) - This discussion is still open and might provide some insights [1].
  2. Application error: a client-side exception has occurred - This issue is closed but was last updated on May 22, 2024. It might contain useful information or solutions [2].

Suggested Solutions

React Error #31

Minified React error #31 typically occurs due to issues with component state or props. Here are some general steps to resolve it:

  1. Check Component State and Props: Ensure that all required props are being passed correctly and that the component state is being managed properly.
  2. Update Dependencies: Make sure all your dependencies, especially React and related libraries, are up to date.
  3. Error Boundaries: Implement error boundaries in your React application to catch and handle errors gracefully.

Workflow Preview Feature

The WorkflowPreview component in Dify is responsible for displaying different panels based on the workflow state. It has dependencies on several React components like ResultText, ResultPanel, TracingPanel, etc. Ensure these components are functioning correctly and that their state and props are managed properly [3].

Error Handling in Dify

The api/extensions/ext_sentry.py module is responsible for handling client-side exceptions and error reporting in Dify. It initializes Sentry for error tracking and integrates it with Flask and Celery [4].

If the issue persists, consider checking the browser console for specific error messages and reviewing the application and service logs for more detailed insights.

To continue talking to Dosu, mention @dosu.

danialcheung commented 2 weeks ago

Update: I have found that disabling the "Follow-up" feature has solved the issue for now.

iamjoel commented 2 weeks ago

Could you please give me the app DSL to reproduce it? @danialcheung

danialcheung commented 2 weeks ago

@iamjoel Sure, I've made a simple workflow that causes the error. Nothing special about it other than having the 'Follow-up' feature enabled. Just rename the extension back to .yml For Debugging.yml.txt

iamjoel commented 2 weeks ago

Maybe the issue is caused by qwen2:72b to generate the 'Follow-up' suggestions. I don't have the api key of qwen2:72b . I can't reproduce the issue when I use models of openai with 'Follow-up' feature enabled. When the issue happens, see if the suggested-questions api return the errror info. @danialcheung

image