[Chore/Refactor] Fix typescript check error #19573

Closed
opened 2026-02-21 20:01:26 -05:00 by yindo · 0 comments
Owner

Originally created by @ZeroZ-lab on GitHub (Oct 18, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactoring, 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Description

Based on the staged changes, here are the specific issues for each file:

1. web/app/components/workflow/block-selector/types.ts

Issue: Property 'output_schema' does not exist on type 'ToolDefaultValue'

  • The ToolDefaultValue type was missing the output_schema field that was being accessed in other components

2. web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx

Issue: Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'. Type 'undefined' is not assignable to type 'Record<string, any>'

  • Accessing tool!.output_schema could return undefined, but the target property required a non-undefined value

3. web/app/components/workflow/datasets-detail-store/provider.tsx

Issue: Expected 1 arguments, but got 0

  • The useRef hook was called without providing the required initial value argument

4. web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx

Issue: Property 'isShowLetterIndex' does not exist on type 'IntrinsicAttributes & Props'

  • The Tool component was receiving a prop isShowLetterIndex that doesn't exist in its Props interface

5. web/app/components/workflow/block-selector/tool-picker.tsx

Issue: Property 'onTagsChange' is missing in type but required in type 'AllToolsProps'

  • The AllTools component requires an onTagsChange prop but it wasn't being passed

6. web/app/components/workflow/block-selector/use-sticky-scroll.ts

Issue: Type 'RefObject<HTMLDivElement | null>' is not assignable to type 'RefObject'. Type 'HTMLDivElement | null' is not assignable to type 'HTMLElement'. Type 'null' is not assignable to type 'HTMLElement'

  • The hook's type definition didn't accept nullable RefObject types, which is the standard return type of useRef

Motivation

No response

Additional Context

No response

Originally created by @ZeroZ-lab on GitHub (Oct 18, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for refactoring, 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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Description Based on the staged changes, here are the specific issues for each file: ## 1. `web/app/components/workflow/block-selector/types.ts` **Issue:** Property 'output_schema' does not exist on type 'ToolDefaultValue' - The `ToolDefaultValue` type was missing the `output_schema` field that was being accessed in other components ## 2. `web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx` **Issue:** Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'. Type 'undefined' is not assignable to type 'Record<string, any>' - Accessing `tool!.output_schema` could return `undefined`, but the target property required a non-undefined value ## 3. `web/app/components/workflow/datasets-detail-store/provider.tsx` **Issue:** Expected 1 arguments, but got 0 - The `useRef` hook was called without providing the required initial value argument ## 4. `web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx` **Issue:** Property 'isShowLetterIndex' does not exist on type 'IntrinsicAttributes & Props' - The `Tool` component was receiving a prop `isShowLetterIndex` that doesn't exist in its Props interface ## 5. `web/app/components/workflow/block-selector/tool-picker.tsx` **Issue:** Property 'onTagsChange' is missing in type but required in type 'AllToolsProps' - The `AllTools` component requires an `onTagsChange` prop but it wasn't being passed ## 6. `web/app/components/workflow/block-selector/use-sticky-scroll.ts` **Issue:** Type 'RefObject<HTMLDivElement | null>' is not assignable to type 'RefObject<HTMLElement>'. Type 'HTMLDivElement | null' is not assignable to type 'HTMLElement'. Type 'null' is not assignable to type 'HTMLElement' - The hook's type definition didn't accept nullable RefObject types, which is the standard return type of `useRef` ### Motivation _No response_ ### Additional Context _No response_
yindo added the refactor label 2026-02-21 20:01:26 -05:00
yindo closed this issue 2026-02-21 20:01:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#19573