fix: Broken import in .storybook/preview.tsx #21558

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

Originally created by @lyzno1 on GitHub (Jan 10, 2026).

Problem

The file .storybook/preview.tsx has a broken import on line 5:

import I18N from '../app/components/i18n'

This module does not exist. The actual i18n components are located at:

  • app/components/provider/i18n.tsx
  • app/components/provider/i18n-server.tsx

Why This Was Not Caught

  1. TypeScript: The glob pattern **/*.tsx in tsconfig.json does not match hidden directories (those starting with .). Since .storybook/preview.tsx is not imported by any other file in the project, it is never included in the compilation.

  2. ESLint: No import/no-unresolved rule is configured to detect missing modules.

Suggested Fix

Update the import path to point to the correct location:

import I18N from '../app/components/provider/i18n'

Or explicitly include .storybook in tsconfig.json:

{
  "include": [
    ".storybook/**/*.ts",
    ".storybook/**/*.tsx",
    ...
  ]
}
Originally created by @lyzno1 on GitHub (Jan 10, 2026). ## Problem The file `.storybook/preview.tsx` has a broken import on line 5: ```tsx import I18N from '../app/components/i18n' ``` This module does not exist. The actual i18n components are located at: - `app/components/provider/i18n.tsx` - `app/components/provider/i18n-server.tsx` ## Why This Was Not Caught 1. **TypeScript**: The glob pattern `**/*.tsx` in `tsconfig.json` does not match hidden directories (those starting with `.`). Since `.storybook/preview.tsx` is not imported by any other file in the project, it is never included in the compilation. 2. **ESLint**: No `import/no-unresolved` rule is configured to detect missing modules. ## Suggested Fix Update the import path to point to the correct location: ```tsx import I18N from '../app/components/provider/i18n' ``` Or explicitly include `.storybook` in `tsconfig.json`: ```json { "include": [ ".storybook/**/*.ts", ".storybook/**/*.tsx", ... ] } ```
yindo closed this issue 2026-02-21 20:13:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21558