Autodocs page is missing props, emits and slots for Vue components in vue project #28817
-
SummaryYesterday I migrated from Storybook Since then, the autodocs page is bascially empty, only showing the component and the source code, but no props, no emits and so on. It only shows any controls if I explicitly set args in a story. If I don't set any args, the autodocs page is bascially empty. This is my component
This is my story:
This is what I get in storybook - bascially a useless page: Project setup: Storybook main.ts
Storybook preview.ts
Our projects lools like this:
This is the .tsconfig in the .storybook folder:
I created a Storybook sandbox project using the Storybook CLI. The autodocs feature works fine there, but I don't see any difference to our project. The only difference is that the sandbox project uses a vite.config.ts, which we don't have. I tried that, but it created lots of problems since Vite couldn't translate our path aliases from the .tsconfig anymore (even though I was using the Can someone tell me what I am missing here? Additional informationStorybook Environment Info: System: Result of the storybook doctor: Create a reproductionNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I configured a sandbox similar to how I assume yours is and noticed the problem. So, I debugged the docgen plugin's transformer and saw the source code it received didn't look the same as what a Try adding the following to the bottom of your const idx = (config.plugins as any).findIndex(x => x?.name === 'storybook:vue-docgen-plugin')
const plugin = config.plugins[idx]
config.plugins.splice(idx, 1)
config.plugins.push(plugin) I don't know much about Vue, so I don't know if there is a known better way to handle this. All I did was follow the code and make it work. |
Beta Was this translation helpful? Give feedback.
I configured a sandbox similar to how I assume yours is and noticed the problem. So, I debugged the docgen plugin's transformer and saw the source code it received didn't look the same as what a
vite.config.ts
got. So, I moved the docgen plugin to the end of the array and it worked.Try adding the following to the bottom of your
viteFinal
function.I don't know much about Vue, so I don't know if there is a known better way to handle this. All I did was follow the code and make it work.