TS5097: An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled. #14361

Closed
opened 2026-02-21 19:16:53 -05:00 by yindo · 1 comment
Owner

Originally created by @kenwoodjw on GitHub (Jun 1, 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

main

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled

https://github.com/langgenius/dify/blob/b33f8b47ca0e6c0abc1aa34ddfca3d7042f8c9b9/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-string.tsx#L6

https://github.com/langgenius/dify/blob/b33f8b47ca0e6c0abc1aa34ddfca3d7042f8c9b9/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-number.tsx#L6

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @kenwoodjw on GitHub (Jun 1, 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 main ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled https://github.com/langgenius/dify/blob/b33f8b47ca0e6c0abc1aa34ddfca3d7042f8c9b9/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-string.tsx#L6 https://github.com/langgenius/dify/blob/b33f8b47ca0e6c0abc1aa34ddfca3d7042f8c9b9/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-number.tsx#L6 ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:16:53 -05:00
Author
Owner

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

The TS5097 error occurs because TypeScript only allows import paths ending with a .tsx extension if the allowImportingTsExtensions option is enabled in your TypeScript configuration. In the Dify codebase, this option is not currently set in the main web/tsconfig.json file, which is why you're seeing this error when importing .tsx files with their extension in the path.

To resolve this, add the following line to the compilerOptions section of your web/tsconfig.json:

"allowImportingTsExtensions": true

For example:

{
  "compilerOptions": {
    // ...other options...
    "allowImportingTsExtensions": true
  }
}

There are no existing issues or documentation entries about this error or setting in the Dify repository. The configuration is centralized, so you only need to update this single file to enable the option and resolve the error you encountered
web/tsconfig.json.

To reply, just mention my name @dosu.


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

@dosubot[bot] commented on GitHub (Jun 1, 2025): <!-- Answer --> The TS5097 error occurs because TypeScript only allows import paths ending with a `.tsx` extension if the `allowImportingTsExtensions` option is enabled in your TypeScript configuration. In the Dify codebase, this option is not currently set in the main `web/tsconfig.json` file, which is why you're seeing this error when importing `.tsx` files with their extension in the path. To resolve this, add the following line to the `compilerOptions` section of your `web/tsconfig.json`: ```json "allowImportingTsExtensions": true ``` For example: ```json { "compilerOptions": { // ...other options... "allowImportingTsExtensions": true } } ``` There are no existing issues or documentation entries about this error or setting in the Dify repository. The configuration is centralized, so you only need to update this single file to enable the option and resolve the error you encountered [web/tsconfig.json](https://github.com/langgenius/dify/blob/b33f8b47ca0e6c0abc1aa34ddfca3d7042f8c9b9/web/tsconfig.json). <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e1248b2c-2035-4977-aca7-478d972e471e?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/20542)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14361