Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
openInBrowser(address);
}
} catch (error) {
// this is a weird bugfix, somehow 'node-pre-gyp' is polluting the npmLog header
npmLog.heading = '';
if (error instanceof Error) {
if (error.error) {
logger.error(error.error);
} else if (error.stats && error.stats.compilation.errors) {
error.stats.compilation.errors.forEach(e => logger.plain(e));
} else {
logger.error(error);
}
}
logger.line();
logger.warn(
error.close
? dedent`
FATAL broken build!, will close the process,
Fix the error below and restart storybook.
`
: dedent`
Broken build, fix the error above.
You may need to refresh the browser.
`
);
logger.line();
if (options.smokeTest || (error && error.close)) {
process.exit(1);
}
errorDetails: true,
errors: true,
warnings: true,
entrypoints: false,
modules: false,
assets: false,
reasons: false,
source: false,
chunks: false,
children: false,
// @ts-ignore
chunkGroups: false,
chunkModules: false,
});
logger.line();
logger.info(JSON.stringify(displayStats));
warnings.forEach(e => {
logger.line();
logger.warn(e);
});
errors.forEach(e => {
logger.line();
logger.error(e);
});
reportStats(stats);
if (!err) {
if (errors.length) {
reportError(new Error('compilation ended with errors'));
} else {
(err, stats) => {
managerTotalTime = process.hrtime(startTime);
if (!resolved && (err || stats.hasErrors())) {
const error = new Error('Manager build is broken');
error.error = err;
error.close = true;
error.stats = stats;
logger.line();
logger.line();
try {
previewReject(error);
previewProcess.close();
logger.warn('force closed preview build');
} catch (e) {
logger.warn('Unable to close preview build!');
}
logger.line();
reject(error);
} else {
resolve(stats);
}
}
);