Skip to content

Preserve build errors when closeBundle fails - #6554

Merged
lukastaegert merged 3 commits into
rollup:masterfrom
Jo2234:fix/preserve-build-error-on-cleanup
Oct 7, 2026
Merged

lukastaegert merged 3 commits into
rollup:masterfrom
Jo2234:fix/preserve-build-error-on-cleanup

Conversation

@Jo2234

@Jo2234 Jo2234 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes
  • no

Breaking Changes?

  • yes
  • no

List any relevant issue numbers:

Description

When a build or buildEnd hook fails and closeBundle also rejects, cleanup currently replaces the original build diagnostic. This awaits cleanup and preserves the original or existing compound error across all three failed-build paths, including its plugin and source metadata. Standalone bundle.close() errors continue to propagate.

Five function fixtures cover the three affected paths, successful cleanup after a build failure, and a standalone close failure. The three regression cases fail before the fix; all five pass afterward. The plugin documentation now states the precedence.

Validation

  • Current-source CJS/ESM builds and full Node suite: 5,499 tests pass.
  • npm run ci:lint: passes, including pinned nightly Rust formatting/Clippy.
  • Documentation build and independent watch recovery, cleanup ordering, unfinished-hook and error identity controls: pass.
  • The standard TypeScript command stops on the existing @types/rimraf reference to glob.IOptions; the same error reproduces using dependency declarations alone. API/project/scripts/docs checks pass with --skipLibCheck. No dependency or lockfile changes.
  • Browser/WASM runtime suites were not run. Node tests use the locked published native parser with the changed TypeScript build.

generated with AI

@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

@Jo2234 is attempting to deploy a commit to the rollup-js Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rollup Ready Ready Preview Oct 7, 2026 3:19pm UTC

Request Review

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.29%. Comparing base (9863ae7) to head (4180452).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6554   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         378      378           
  Lines       13728    13728           
  Branches     2920     2920           
=======================================
  Hits        13494    13494           
  Misses        191      191           
  Partials       43       43           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Performance report

  • BUILD: 7156ms, 833 MB (+3%)
    • initialize: 0ms, 23.7 MB
    • generate module graph: 2698ms, 625 MB
      • generate ast: 1370ms, 618 MB
    • sort and bind modules: 400ms, 683 MB
    • mark included statements: 4058ms, 833 MB (+3%)
      • treeshaking pass 1: 2333ms, 834 MB (+3%)
      • treeshaking pass 2: 485ms, 837 MB (+2%)
      • treeshaking pass 3: 419ms, 832 MB (+3%)
      • treeshaking pass 4: 405ms, 833 MB (+3%)
      • treeshaking pass 5: 402ms, 833 MB (+3%)
  • GENERATE: 611ms, 886 MB
    • initialize render: 0ms, 833 MB (+3%)
    • generate chunks: 38ms, 827 MB
      • optimize chunks: 0ms, 826 MB
    • render chunks: 560ms, 860 MB
    • transform chunks: 14ms, 886 MB
    • generate bundle: 0ms, 886 MB

@lukastaegert
lukastaegert added this pull request to the merge queue Oct 7, 2026
Merged via the queue into rollup:master with commit 76c631a Oct 7, 2026
48 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

This PR has been released as part of [email protected]. You can test it via npm install rollup.

graphite-app Bot pushed a commit to rolldown/rolldown that referenced this pull request Nov 20, 2026
Partial implementation of rollup/rollup#6554. The behavior of `closeBundle` seems to be different, but fixing that seems to require changing many codes around [`Bundle.close`](https://github.com/rolldown/rolldown/blob/main/internal-docs/rust-bundler/implementation.md#bundlehandleclose--design-decision) so I left it for now.

This branch was successfully deployed

1 active deployment
Preview — 4180452b Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants