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

(cherry picked from commit ea5c910)
  • Loading branch information
plumcoding authored and FrozenPandaz committed May 9, 2024
1 parent e3c183d commit d3d0129
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 d3d0129

Please sign in to comment.