You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the ".stories.ts" file doesn't import the component directly but imports a file that exports the component, the storybook reports the error. I can reproduce this by using the generated demo. Here is what I did:
After executing the npx storybook@latest init, create a file "import.ts" under the ".stories" file with the content export {Button, ButtonProps} from "./Button";.
Then change the "Button.stories.ts" file to import from the "import.ts" instead of the "Button.tsx".
Run npm run storybook and open the Button story, you will see the error "The requested module '/stories/Button.tsx' does not provide an export named 'ButtonProps'".
If I change the "import.ts" to export * from "./Button", then everything works.
Describe the bug
If the ".stories.ts" file doesn't import the component directly but imports a file that exports the component, the storybook reports the error. I can reproduce this by using the generated demo. Here is what I did:
npx storybook@latest init
, create a file "import.ts" under the ".stories" file with the contentexport {Button, ButtonProps} from "./Button";
.npm run storybook
and open the Button story, you will see the error "The requested module '/stories/Button.tsx' does not provide an export named 'ButtonProps'".If I change the "import.ts" to
export * from "./Button"
, then everything works.This only occurs when using typescript.
Reproduction link
https://github.com/zhaoyu1999/storybook-test
Reproduction steps
npm run storybook
System
Additional context
No response
The text was updated successfully, but these errors were encountered: