From e6ee757ccec3cb465ce3f4e60c963adcbe4691cc Mon Sep 17 00:00:00 2001 From: "aspire-repo-bot[bot]" <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 00:21:21 +0000 Subject: [PATCH 1/2] docs: document TypeScript validation before AppHost startup TypeScript AppHosts now run tsc --noEmit before starting, which stops aspire run/publish when type errors are present. Document this behavior including watch mode recovery and startup overhead. Documents changes from microsoft/aspire#16689. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../docs/app-host/typescript-apphost.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/frontend/src/content/docs/app-host/typescript-apphost.mdx b/src/frontend/src/content/docs/app-host/typescript-apphost.mdx index d90adaf738..794009ee9c 100644 --- a/src/frontend/src/content/docs/app-host/typescript-apphost.mdx +++ b/src/frontend/src/content/docs/app-host/typescript-apphost.mdx @@ -249,6 +249,24 @@ The `aspire doctor` command checks that the required JavaScript toolchain execut aspire doctor ``` +## TypeScript validation before startup + +Before starting a TypeScript AppHost, the Aspire CLI runs `tsc --noEmit` to check for type errors. If your AppHost has TypeScript compile errors, `aspire run` and `aspire publish` stop before the AppHost launches and display the diagnostic output: + +```text +apphost.ts(22,7): error TS2322: Type 'string' is not assignable to type 'number'. +``` + +This prevents the dashboard and resources from starting in a partially broken state. + +:::note +TypeScript validation adds approximately **0.8–1.0 seconds** to startup time on a typical AppHost. +::: + +### Watch mode behavior + +When you use `aspire run` in watch mode, the TypeScript validation is embedded in the nodemon restart command. The watcher **can still start** even if there are initial type errors — it will recover automatically as you edit and save files that fix the errors. + ## See also - [Build your first app](/get-started/first-app/?lang=typescript) From d107de74ffb6a93841dc0fbc6a66a8cc47c3c37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 5 May 2026 07:17:48 -0700 Subject: [PATCH 2/2] Update TypeScript validation section in documentation Clarified TypeScript validation process and its impact on startup time. --- .../src/content/docs/app-host/typescript-apphost.mdx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/frontend/src/content/docs/app-host/typescript-apphost.mdx b/src/frontend/src/content/docs/app-host/typescript-apphost.mdx index 794009ee9c..a81d4b08dc 100644 --- a/src/frontend/src/content/docs/app-host/typescript-apphost.mdx +++ b/src/frontend/src/content/docs/app-host/typescript-apphost.mdx @@ -251,18 +251,12 @@ aspire doctor ## TypeScript validation before startup -Before starting a TypeScript AppHost, the Aspire CLI runs `tsc --noEmit` to check for type errors. If your AppHost has TypeScript compile errors, `aspire run` and `aspire publish` stop before the AppHost launches and display the diagnostic output: +Before starting a TypeScript AppHost, the Aspire CLI runs `tsc --noEmit` to check for type errors to prevent the dashboard and resources from starting in a partially broken state. If your AppHost has TypeScript compile errors, `aspire run` and `aspire publish` stop before the AppHost launches and display the diagnostic output: ```text apphost.ts(22,7): error TS2322: Type 'string' is not assignable to type 'number'. ``` -This prevents the dashboard and resources from starting in a partially broken state. - -:::note -TypeScript validation adds approximately **0.8–1.0 seconds** to startup time on a typical AppHost. -::: - ### Watch mode behavior When you use `aspire run` in watch mode, the TypeScript validation is embedded in the nodemon restart command. The watcher **can still start** even if there are initial type errors — it will recover automatically as you edit and save files that fix the errors.