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..a81d4b08dc 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,18 @@ 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 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'. +``` + +### 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)