-
-
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
Avoid logging an object on compilation errors #2121
Conversation
In certain configurations Storybook might log the whole Webpack build object when warnings or errors are thrown. This was caused by a `logger.error` call inside the `index.js` catch. This fixes by logging the error only when it's an instance of an error.
Codecov Report
@@ Coverage Diff @@
## master #2121 +/- ##
==========================================
- Coverage 21.42% 21.42% -0.01%
==========================================
Files 263 263
Lines 5805 5806 +1
Branches 703 703
==========================================
Hits 1244 1244
+ Misses 4012 4003 -9
- Partials 549 559 +10
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @derekstavis, Thank you for this!
Could you apply the same fix for app/vue
and app/react-native
?
@derekstavis would you like help putting this into the other 2 apps? |
Yes, will do sometime today! Thanks! |
@derekstavis we're looking to get a new release out sometime today. would love to have this in. |
Opened #2199 instead |
Issue
In certain configurations Storybook might log the whole Webpack
build object when warnings or errors are thrown. This was caused
by a
logger.error
call inside theindex.js
catch.What I did
This fixes by logging the error only when it's an instance of an error.
How to test
This branch was tested on https://github.com/pagarme/pilot. Before
this changes, if an error happens while compiling (e.g. imported file not
found) a big object is logged:
Resolves
#1889.
Is this testable with jest or storyshots?
Nope.
Does this need a new example in the kitchen sink apps?
Nope.
Does this need an update to the documentation?
Nope.
If your answer is yes to any of these, please make sure to include it in your PR.