Skip to content

[bug] unmount errors are silently swallowed during cleanup #1757

@ZainabTravadi

Description

@ZainabTravadi

Which package?

@termuijs/jsx

What happened?

Errors thrown during app.unmount() are silently swallowed during cleanup.

Currently the cleanup helper wraps app.unmount() in an empty catch block:

try {
    app.unmount();
} catch {}

As a result, cleanup failures are completely hidden from developers, making unmount-related issues difficult to diagnose.

Expected behavior:

  • Cleanup should continue even if an individual unmount() call fails.
  • The error should be logged so developers can understand why cleanup failed.

Actual behavior:

  • Errors are silently ignored with no logging or diagnostics.

Steps to reproduce

const app = {
  unmount() {
    throw new Error('Unmount failed');
  }
};

// Trigger the cleanup path that invokes app.unmount()

Observe that the error is swallowed and no diagnostic output is produced.

Environment

  • Bun version: 1.x
  • OS: Linux (WSL)
  • Terminal emulator: Windows Terminal
  • TermUI version: Latest main branch

Screenshots or terminal output

Current behavior:

(no output)

Expected behavior:

[jsx] Error during unmount(): Error: Unmount failed

GSSoC contributor?

  • Yes. I contribute under GSSoC 2026.
  • No.

Metadata

Metadata

Assignees

Labels

assignedIssue claimed by a contributor.type:bug+10 pts. Bug fix.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions