-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: react-docgen-typescript not working after v8.4.6 #30015
Comments
I can confirm the bug from the repro, seems to have started in docgen-typescript v0.4.1: If I use pnpm overrides to change the dependency back to 0.4.0, it behaves correctly. @joshwooding do you have any clue what could be happening here? |
@fertolg I found out what is going on. Since 0.4.1 of the {
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
} however, internally, seems like the docgen plugin does not support this referencing of tsconfig files, so then it actually searches for nothing, as stated in your tsconfig.json file. As a solution, you can pass the path to the correct tsconfig file as an option in your main.js: import type { StorybookConfig } from '@storybook/react-vite'
const config: StorybookConfig = {
// ...
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
tsconfigPath: './tsconfig.app.json', // 👈 This solves your problem.
},
},
}
export default config |
I see, thank you @yannbf for looking into this. I'd like to call out this is how Vite 6 scaffolds a project out of the box (with 2 separate |
Definitely! I wanted to give you a path forward so you're not blocked, but we will definitely see what we can do about this, also with the maintainers of the docgen library. Thanks! |
Describe the bug
After v8.4.6, using
react-docgen-typescript
as the argTypes inferrer fails to pick up arguments and JSDoc comments entirely.Reproduction link
https://github.com/fertolg/storybook-8_4_6-react-docgen-typescript-bug
Reproduction steps
pnpm storybook
System
Additional context
You don't have to clone the repo I provided, you can also:
pnpm dlx storybook@latest init
.storybook/main.ts
to usereact-docgen-typescript
.The text was updated successfully, but these errors were encountered: