Open btmnk opened 9 months ago
@btmnk Not sure what your issue exactly is but react-docgen-typescript-plugin is a webpack plugin, so it will not work for Vite. According to the release blog post https://storybook.js.org/blog/storybook-8/#improved-react-and-vue-control-autogeneration there are other tools for vite. Hope it could help you
I think i'm hitting this too with the strapi-design-system, so just leaving a comment to keep in the loop 👍🏼
Describe the bug
Auto generating controls only works if there is a tsconfig.json in the root directory. I started fresh with storybook 7.5 and have a very small monorepo with only one component.
In my root directory I have a tsconfig.base.json and in my components tsconfig.json I extend that via
Storybook doesn't seem to pick it up tough and it's not even logging or erroring in any way that something is missing. The controls just stay empty.
My main.ts:
Initially I had reactDocgenTypescriptOptions filled with the example from https://storybook.js.org/docs/react/configure/typescript but that didn't do anything. The propFilter callback wasn't even called.
By mere chance I realized having a tsconfig.json in my root directory triggered a reload and my props were shown in the Controls panel.
I think Storybook should warn the user that no tsconfig file was found/used when the typescript option is added in the config like above.
The typescript config example also includes "compilerOptions" so at first I assumed a tsconfig.json file is not needed. But those didn't work either and had no effect.
To Reproduce
https://stackblitz.com/edit/github-b3yb1v?file=.storybook%2Fmain.ts
System
Additional context
No response