diff --git a/app/react/src/server/build.js b/app/react/src/server/build.js index 01a4a7394041..b6b9f047e6e7 100755 --- a/app/react/src/server/build.js +++ b/app/react/src/server/build.js @@ -77,9 +77,12 @@ if (program.staticDir) { // compile all resources with webpack and write them to the disk. logger.log('Building storybook ...'); webpack(config).run((err, stats) => { - if (err) { + if (err || stats.hasErrors()) { logger.error('Failed to build the storybook'); - logger.error(err.message); + // eslint-disable-next-line no-unused-expressions + err && logger.error(err.message); + // eslint-disable-next-line no-unused-expressions + stats.hasErrors() && stats.toJson().errors.forEach(e => logger.error(e)); process.exit(1); }