Closed Jack-Works closed 1 year ago
This seems to have already been fixed: https://github.com/hipstersmoothie/react-docgen-typescript-plugin/commit/b6b5d0615e666bee3c931b3e1c1d5b490257fcea
(Unless this didn't get them all.)
oh, thanks! looks like @storybook/react does not use the latest version of this library
they pinned to 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 so does not include that change.
oh sorry please release a new version on npm
@Jack-Works It seems like storybook has their own wrapper of this project (called @storybook/react-docgen-typescript-plugin) which is pinned to version 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0
.
This library is working fine and has been for a while, however the storybook-re-published version is still using an old version without the fix.
https://www.npmjs.com/package/@storybook/react-docgen-typescript-plugin
They list this repo as the source, but this repo says to install it via react-docgen-typescript-plugin
not @storybook/react-docgen-typescript-plugin
.
So storybook must re-publish their package, or switch to using the react-docgen-typescript-plugin
directly. And it looks like they have a PR open as well (I finally found the forked repo here: https://github.com/storybookjs/react-docgen-typescript-plugin/pull/8).
And for anyone having this exact error using storybook with ts-5.0 beta before it's fixed, you can work around it by doing:
npm i --save-dev react-docgen-typescript-plugin
to install this packagemain.js
(or main.ts
) file for storybook:
typescript: {
reactDocgen: 'react-docgen-typescript-plugin'
},
I'm on Storybook 6 and setting the following in main.js doesn't really seem to do anything, storybook just keeps using it's own fork regardless
typescript: {
reactDocgen: 'react-docgen-typescript-plugin'
},
@Jack-Works It seems like storybook has their own wrapper of this project (called @storybook/react-docgen-typescript-plugin) which is pinned to version
1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0
.This library is working fine and has been for a while, however the storybook-re-published version is still using an old version without the fix.
https://www.npmjs.com/package/@storybook/react-docgen-typescript-plugin
They list this repo as the source, but this repo says to install it via
react-docgen-typescript-plugin
not@storybook/react-docgen-typescript-plugin
.So storybook must re-publish their package, or switch to using the
react-docgen-typescript-plugin
directly. And it looks like they have a PR open as well (I finally found the forked repo here: storybookjs#8).And for anyone having this exact error using storybook with ts-5.0 beta before it's fixed, you can work around it by doing:
npm i --save-dev react-docgen-typescript-plugin
to install this package- add this to your
main.js
(ormain.ts
) file for storybook:typescript: { reactDocgen: 'react-docgen-typescript-plugin' },
It seems that Storybook's ability to generate React Component API documents doesn't work. I try:
typescript: {
reactDocgen: 'any-string',
},
The problem with upgrading to Typescript 5 is resolved, but the React Component API documentation functionality is also disabled, which is somewhat similar to the effect of using the none
option.
ts.createIdentifier
is deprecated (usets.factory.create*
instead).See: https://github.com/microsoft/TypeScript/issues/51362#issuecomment-1408126388