Skip to content

Commit 0ab5877

Browse files
committed
fix(init): catch LoggingUIPromptError when InkUI fails to load
When InkUI fails to import in an interactive session, the factory falls back to LoggingUI. confirmExperimental then calls ui.select() which throws LoggingUIPromptError — an error the catch block did not handle, causing an unhandled crash. Catch it and surface a clear WizardError directing the user to --yes.
1 parent fa2a351 commit 0ab5877

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/lib/init/wizard-runner.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import type {
5454
WorkflowRunResult,
5555
} from "./types.js";
5656
import { getUIAsync } from "./ui/factory.js";
57+
import { LoggingUIPromptError } from "./ui/logging-ui.js";
5758
import type { SpinnerHandle, WizardUI } from "./ui/types.js";
5859
import {
5960
precomputeDirListing,
@@ -362,6 +363,12 @@ async function preamble(
362363
process.exitCode = 0;
363364
return false;
364365
}
366+
if (err instanceof LoggingUIPromptError) {
367+
throw new WizardError(
368+
"The interactive UI failed to load. Run with --yes for non-interactive mode.",
369+
{ rendered: false }
370+
);
371+
}
365372
throw err;
366373
}
367374
if (!confirmed) {

0 commit comments

Comments
 (0)