-
Notifications
You must be signed in to change notification settings - Fork 252
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
Tree-shaking on a package (monorepo) breaks docgen. #481
Comments
I made this "minimal" (as much as possible for that stack) reproduction fork: https://github.com/Powerplex/spark-docgen-fix |
Very similar to the monorepo environment I am working on (lerna, react, vite, typescript, storybook) and issue...
yd.__docgenInfo = {
description: '',
methods: [
{ name: 'addLineEventListener', docblock: null, modifiers: [], params: [], returns: null },
{ name: 'addNodeEventListener', docblock: null, modifiers: [], params: [], returns: null },
{
name: 'traverse',
docblock: null,
modifiers: [],
params: [
{ name: 'e', type: null },
{ name: 't', type: null },
{ name: 'n', type: null }
],
returns: null
},
{ name: 'getRightArrowIcon', docblock: null, modifiers: [], params: [], returns: null },
{ name: 'destroy', docblock: null, modifiers: [], params: [], returns: null }
],
displayName: 'yd'
} |
This problem seems more like an issue in If I force upgrade to
My other packages build storybooks with no problem (Angular, Vanilla JS, Svelte, and Vue). |
The same issue causing troubles in storybook storybookjs/storybook#26123 |
Hey :)
We are working on a building a design system named Spark. It is using Vite + Storybook with
react-docgen-typescript
.Recently we rewrote one of our packages
@spark-ui/icon
to have tree shaking, but settings itssideEffects
tofalse
andpreserveModules
totrue
. It works, thedist
folder works and tree-shaking works when importing this package.But not in storybook, which fails because docGen is invalid. Here is an exemple of the file that storybook tries to import:
The error:
The file causing the error (I simplified it because there is normally hundreds of icons):
As you can see, docgen is trying to attach data to
d
ando
instead ofdf
andyf
. What could cause that ?Thanks :3
The text was updated successfully, but these errors were encountered: