-
-
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
build-storybook fails with storybook-addon-jsx #1774
Comments
@nicolaskruchten I'd say the problem is this: algolia/react-element-to-jsx-string#140 |
I suspect it will get fixed by #1733 |
An alternative (workaround) solution is to alter the webpack config to compile just the relevant node modules. This works: {
test: /\.js$/,
loader: 'babel-loader',
include: /node_modules\/(stringify-object|get-own-enumerable-property-symbols)/,
}, (I know all this because I ran into this bug in a different context just the other day, although not in storybook) |
Ah, thanks @tmeasday that's really helpful! Question: when you say "alter the webpack config" which config do you mean? Do you mean via the "full control" mechanism here https://storybook.js.org/configurations/custom-webpack-config/ ? |
Ah, I see there's a solution with full-control mode here: #1570 |
I tried the workarounds here and #1570 but they either break resolution, or loaders. I concur with the other discussion on 1570 why is there an uglify plugin against src and not babel parsed code? Either pull the plugin or pre parse it with babel before the uglify. |
@leetercola the thing is that loaders (including |
I don't think you can selectively apply uglify, it will run over the whole webpack-ed bundle, which includes your code, and things from Of course it's no longer true that it's unnecessary if people are going around publishing uncompiled ES6 packages that are not targeted at the browser. This is what's happening in this case. So my solution above is to tweak the webpack config to ask it to selectively apply babel inside @leetercola are you sure that you implemented what I was talking about above correctly? I have not solved this particular problem for |
Meanwhile I should add this whole situation is messed up and it should not be your responsibility to fix it. It doesn't look like the original package author is likely to change his stance on pre-compiling his package, so I would say the next best solution in the short term is the author of storybook-addon-jsx (@Kilix) should figure out a way to depend on a pre-compiled version of Otherwise, this should fix it eventually: #1733 |
* docs(storybook): add jsx addon * docs(storybook): add method to display correct component names * docs(storybook): add jsx usage to the stories * docs(storybook): update yarn.lock * docs(storybook): modify webpack config to fix build-storybook fail See storybookjs/storybook#1774 * docs(storybook): filter out unnecessary props * docs(storybook): updates after reviews on PR
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
When I activate https://github.com/Kilix/storybook-addon-jsx and run
build-storybook
I get the following error:It seems like Uglify is failing on some ES6 input, specifically an arrow function (that's what's on line 44048 in that JS file, and it's the first line where an arrow function appears).
To reproduce:
npm install
npm run build-storybook
I've filed an issue in the addon repo (storybookjs/addon-jsx#16), but I wonder if this isn't a framework problem...?
The text was updated successfully, but these errors were encountered: