Skip to content

Fix TS definite-assignment error in src/run-live.ts (caller used before assigned) #9

Description

@williamzujkowski

Problem

tsc --noEmit reports:

src/run-live.ts(32,37): error TS2454: Variable 'caller' is used before being assigned.

caller is declared let caller: ToolCaller; and assigned inside a try/catch whose catch branch calls process.exit(1). TypeScript's strict control-flow analysis does not treat process.exit as never-returning, so it sees a path where caller is unassigned at line 32.

Suggested fix

Restructure so the assignment is provably definite, e.g. move the live-mode logic into the try block, or have the catch return/throw after logging, or assign directly: const caller = await loadCaller(); where loadCaller throws instead of exiting. This is a genuine strict-mode compile error and will block pnpm build once @types/node is added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions