-
-
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
Storybook 6.2.0-beta.4 through 6.2.0-rc.1 fails to display any stories due to prettier ES5 transpilation #14262
Comments
As a work around, you could make a change in main.js, changing the webpack config with the change described above. |
I thought about that, but wasn't sure how to do it really properly. Do I have to remove the existing rule first, and then re-add my adjusted rule? |
You can mutate / replace the object in the config |
yes, I know this is a pain, but unfortunately something we can't make it any easier on you, because we're constrained by webpack's api.. I suggest finding the module.rule that has a include that's a regex that matches |
Probable dupe to #14197 |
OK closing as dupe to #14197 , thanks! |
Upgrade Babel. This was fixed in v7.12.13 (2021-02-03) by babel/babel#12544 |
Describe the bug
When upgrading to any version past beta.3, my storybook fails all stories due to an error in the console:
After alot of digging, it seems this PR #14047 made the change in es6Transpiler, adding
prettier
to the regex list of packages to transpile to ES5. For some reason the transpiled version is wrong in my repository, but not in the storybook Angular-cli example.What is generated for the failing function in my repo is:
Whereas in the working storybook-repo:
It's not easy to spot at first, but in the failing example, the
var r
is causing the problem, rescopingr
from being the actual object passed in to_createClass
to now simply a boolean.To Reproduce
I've attempted imitate configuration and settings as closely as I can in my project, but to no avail. I did manage to create a repository that reproduces the error: https://github.com/yngvebn/storybook-babel
The repository is a stripped down version of the one I work in daily, so it's as real as it gets.
Steps to reproduce the behavior:
Clone https://github.com/yngvebn/storybook-babel
Run
npm install
Run
npm start-storybook
Expected behavior
Expect stories to work.
Screenshots
All stories ends up looking like this:
Code snippets
If applicable, add code samples to help explain your problem.
System
Additional context
If I manually find es6Transpiler.js in node_modules, and remove prettier from the regex, everything works as it should.
The text was updated successfully, but these errors were encountered: