Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Not generating new story files#30860
-
SummaryI'm having some trouble setting up Storybook for the first time. The example stories were causing errors (something about duplicate keys), so I just deleted them. Then I created a basic component in
It didn't actually generate any files; There's no "stories": ["../stories/**/*.mdx","../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)" ], If it helps, I tried adding this to the list: "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)", Then it does generate the story file in Additional information.storybook/main.ts importtype{StorybookConfig}from'@storybook/react-vite';import{join,dirname}from"path"/*** This function is used to resolve the absolute path of a package.* It is needed in projects that use Yarn PnP or are set up within a monorepo.*/functiongetAbsolutePath(value:string):any{returndirname(require.resolve(join(value,'package.json')))}constconfig:StorybookConfig={"stories":["../stories/**/*.mdx","../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",],"addons":[getAbsolutePath('@storybook/addon-essentials'),getAbsolutePath('@storybook/addon-onboarding'),getAbsolutePath('@chromatic-com/storybook'),getAbsolutePath("@storybook/experimental-addon-test")],"framework":{"name":getAbsolutePath('@storybook/react-vite'),"options":{}}};exportdefaultconfig; Create a reproductionUnable to reproduce in StackBlitz |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
-
Ok, had a similar problem. I was trying to add a story for a component that was in stories: [+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)", "../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", ], It started to work. Do note that you might encounter a different error which is discussedhere. |
BetaWas this translation helpful?Give feedback.