Dify Application error: a client-side exception has occurred while loading

プログラミング

Difyでチャットフローを編集していたら、突然以下のエラーで編集できなくなった。

Application error: a client-side exception has occurred while loading {url} (see the browser console for more information).

いやどういうこと? 他のフローは編集できるんだけど??

Export DSL はできたので、DSL を見てみると、だいたい以下のような構造になっている。

app:
dependencies:
kind:
version:
workflow:
  conversation_variables:
  environment_variables:
  features:
  graph:
    edges:
    - data:
    - data:
    - data:
    ……

いや分からん! ていうか6000行以上あるし、複雑すぎる!

DSL がエラーの原因説があったので、どうにか調べてみたところ、以下のノードを発見。

    - data:
        code: "\ndef main(arg1: str, arg2: str) -> dict:\n    return {\n        \"\
          result\": arg1 + arg2,\n    }\n"
        code_language: python3
        desc: ''
        isInIteration: false
        isInLoop: true
        loop_id: '1749945923061'
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: Code 10
        type: code
        variables:
        - value_selector: ''
          variable: arg1
        - value_selector:
          - '1748764171152'
          - text
          variable: arg2
      height: 54
      id: '1749947702123'
      parentId: '1749945923061'
      position:
        x: 107.81279380847673
        y: 68
      positionAbsolute:
        x: 3785.8127938084767
        y: 1117
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
      zIndex: 1002

お気づきだろうか……

        variables:
        - value_selector: ''
          variable: arg1
        - value_selector:
          - '1748764171152'
          - text
          variable: arg2

どうやらこいつ ( value_selector: '' ) が原因らしい。

他に合わせて直してみる。

        variables:
        - value_selector:
          - '1748764171152'
          - text
          variable: arg1
        - value_selector:
          - '1748764171152'
          - text
          variable: arg2

Import してみると……読み込めた!!

いやこんなエラー分かるかい!

まじで普通に編集中に、突然 Application error の画面に切り替わって編集できなくなったので、1日分の作業が消え去ったかと思ってめちゃくちゃ焦った。

いや復旧させるのに数時間費やしたんですけどね。

無事解決できてホッとした。

For English Readers

While editing a chatflow in Dify, I suddenly encountered an “Application error” screen, and I was no longer able to continue editing. Fortunately, I was still able to export the workflow as a DSL YAML file.

When I checked the exported YAML, I found the following node:

    - data:
        code: "\ndef main(arg1: str, arg2: str) -> dict:\n    return {\n        \"\
          result\": arg1 + arg2,\n    }\n"
        code_language: python3
        desc: ''
        isInIteration: false
        isInLoop: true
        loop_id: '1749945923061'
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: Code 10
        type: code
        variables:
        - value_selector: ''
          variable: arg1
        - value_selector:
          - '1748764171152'
          - text
          variable: arg2
      height: 54
      id: '1749947702123'
      parentId: '1749945923061'
      position:
        x: 107.81279380847673
        y: 68
      positionAbsolute:
        x: 3785.8127938084767
        y: 1117
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
      zIndex: 1002

The problem was the line with value_selector: ''.

To fix this, I manually edited the YAML like this:

        variables:
        - value_selector:
          - '1748764171152'
          - text
          variable: arg1
        - value_selector:
          - '1748764171152'
          - text
          variable: arg2

After this change, I was able to successfully import the DSL back into Dify and resume editing without any issues.

コメント

タイトルとURLをコピーしました