When I was developing a Dify plugin and using the “model-selector” parameter type, an error occurred. #14450

Closed
opened 2026-02-21 19:17:17 -05:00 by yindo · 2 comments
Owner

Originally created by @huangxttttt on GitHub (Jun 5, 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.2.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

TypeError: Cannot read properties of null (reading 'split')
at ModelParameterModal (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/model-selector/index.tsx:39:30)
at renderField (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:437:96)
at eval (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:626:49)
at Array.map ()
at Form (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:626:31)
at ConfigCredential (webpack-internal:///(app-pages-browser)/./app/components/tools/setting/build-in/config-credentials.tsx:100:96)
at ActionList (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/action-list.tsx:146:107)
at PluginDetailPanel (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/index.tsx:57:129)
at PluginsPanel (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-page/plugins-panel.tsx:170:88)
at PluginList (rsc://React/Server/webpack-internal:///(rsc)/./app/(commonLayout)/plugins/page.tsx?25:19:93)

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @huangxttttt on GitHub (Jun 5, 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.2.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce TypeError: Cannot read properties of null (reading 'split') at ModelParameterModal (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/model-selector/index.tsx:39:30) at renderField (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:437:96) at eval (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:626:49) at Array.map (<anonymous>) at Form (webpack-internal:///(app-pages-browser)/./app/components/header/account-setting/model-provider-page/model-modal/Form.tsx:626:31) at ConfigCredential (webpack-internal:///(app-pages-browser)/./app/components/tools/setting/build-in/config-credentials.tsx:100:96) at ActionList (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/action-list.tsx:146:107) at PluginDetailPanel (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-detail-panel/index.tsx:57:129) at PluginsPanel (webpack-internal:///(app-pages-browser)/./app/components/plugins/plugin-page/plugins-panel.tsx:170:88) at PluginList (rsc://React/Server/webpack-internal:///(rsc)/./app/(commonLayout)/plugins/page.tsx?25:19:93) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:17:17 -05:00
yindo closed this issue 2026-02-21 19:17:17 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 5, 2025):

The error happens because the scope prop passed to the ModelParameterModal is null or undefined, but the component tries to call .split('&') on it without checking. This is a known issue in Dify 1.2.0 and can be triggered by a misconfiguration in your plugin YAML.

To fix it, make sure your model-selector parameter in your plugin YAML looks like this:

parameters:
  - name: model
    type: model-selector
    scope: llm
    required: true
    form: form  # This must be 'form', not 'llm'

If you use form: llm, it can cause the error you’re seeing. Changing it to form: form resolves the issue in most cases [source].

If you are customizing the component or passing scope yourself, ensure you always provide a non-null string (for example, 'llm' or 'all'). If you cannot upgrade to Dify 1.3.0, also check that your PluginDeclaration includes a meta field, as missing it can cause other plugin errors [source].

Let me know if you need help with the YAML or want to see a full example.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 5, 2025): <!-- Answer --> The error happens because the `scope` prop passed to the `ModelParameterModal` is `null` or `undefined`, but the component tries to call `.split('&')` on it without checking. This is a known issue in Dify 1.2.0 and can be triggered by a misconfiguration in your plugin YAML. To fix it, make sure your `model-selector` parameter in your plugin YAML looks like this: ```yaml parameters: - name: model type: model-selector scope: llm required: true form: form # This must be 'form', not 'llm' ``` If you use `form: llm`, it can cause the error you’re seeing. Changing it to `form: form` resolves the issue in most cases [[source]](https://github.com/langgenius/dify/issues/15631). If you are customizing the component or passing `scope` yourself, ensure you always provide a non-null string (for example, `'llm'` or `'all'`). If you cannot upgrade to Dify 1.3.0, also check that your `PluginDeclaration` includes a `meta` field, as missing it can cause other plugin errors [[source]](https://github.com/langgenius/dify/issues/18423). Let me know if you need help with the YAML or want to see a full example. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/addd402f-eec9-4bcb-95a6-cd437e6121b8?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20726)
Author
Owner

@crazywoola commented on GitHub (Jun 6, 2025):

Duplicated https://github.com/langgenius/dify/issues/20500

@crazywoola commented on GitHub (Jun 6, 2025): Duplicated https://github.com/langgenius/dify/issues/20500
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14450