Skip to content

Commit

Permalink
fix(bundling): rollup does not log build errors (#23141)
Browse files Browse the repository at this point in the history
closed 22896

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
given using @nx/rollup:rollup executor
when an error is thrown
then no message is logged (just stacktrace)

## Expected Behavior
error message to be displayed (as it was till v18.2.0)

## Related Issue(s)

Fixes #22896
  • Loading branch information
plumcoding authored May 8, 2024
1 parent fd78152 commit ea5c910
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/rollup/src/executors/rollup/rollup.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ export async function* rollupExecutor(
return { success: true, outfile };
} catch (e) {
if (e.formatted) {
// Formattted message is provided by Rollup and contains codeframes for where the error occurred.
logger.info(e.formatted);
} else if (e.message) {
logger.info(e.message);
}
logger.error(e);
logger.error(`Bundle failed: ${context.projectName}`);
Expand Down

0 comments on commit ea5c910

Please sign in to comment.