Conversation
Currently, storybook does not exit non-zero when there are errors in the pipeline, e.g. we are using TypeScript with `ts-loader` and a type error that fails tsc does not make storybook exit non-zero even though the transpilation failed.
| return logger.error(e); | ||
| }); | ||
| } | ||
| if (err || stats.hasErrors()) { |
There was a problem hiding this comment.
if(err || stats.hasErrors()) {
const errors = err ? [err] : stats.toJson().errors
errors.forEach(...)
process.exit(1)
}
There was a problem hiding this comment.
that would not print the stats errors if there is a "normal" error - is that deliberate?
There was a problem hiding this comment.
sorry, main point is that i think it should just be a single if statement
Codecov Report
@@ Coverage Diff @@
## master #1372 +/- ##
==========================================
- Coverage 14.1% 14.09% -0.01%
==========================================
Files 201 201
Lines 4609 4611 +2
Branches 502 583 +81
==========================================
Hits 650 650
+ Misses 3521 3463 -58
- Partials 438 498 +60
Continue to review full report at Codecov.
|
|
Just tested |
|
@mrmartineau it could have been a hidden issue before, if the error was swallowed and never printed and also not changed the exit code. The changes in this PR would pick up such a hidden problem. |
Currently, storybook does not exit non-zero when there are errors in the pipeline, e.g. we are using TypeScript with
ts-loaderand a type error that fails tsc does not make storybook exit non-zero even though the transpilation failed.Issue:
What I did
Run
build-storybookwith a "broken" typescript source.How to test
Any transpiler (for example typescript) producing an error will still not make storybook exit non-zero.