-
Notifications
You must be signed in to change notification settings - Fork 850
Description
Description
When a TypeScript AppHost project has multiple packages in aspire.config.json, the bundle mode SDK codegen generates a TypeScript SDK that only contains core Aspire.Hosting functions — the integration-specific functions (e.g., addUvicornApp from Aspire.Hosting.Python, addViteApp from Aspire.Hosting.JavaScript) are missing.
Reproduction
Create a TypeScript AppHost with aspire.config.json containing two packages:
{
"packages": {
"Aspire.Hosting.JavaScript": "...",
"Aspire.Hosting.Python": "..."
}
}Run aspire run (or aspire start). The app crashes with:
❌ Uncaught Exception: builder.addUvicornApp is not a function
TypeError: builder.addUvicornApp is not a function
Key Observations
- Single package works: The TypeScript starter template (
Aspire.Hosting.JavaScriptonly) generates a correct SDK withaddExpressApp,addViteApp, etc. ✅ - Multiple packages fails: The Python starter template (
Aspire.Hosting.JavaScript+Aspire.Hosting.Python) generates a SDK with only coreAspire.Hostingfunctions — NEITHER JavaScript nor Python functions are present. ❌ - This only affects bundle mode (native AOT CLI). SDK mode (
dotnet run) works correctly. - The generated SDK file is 16K lines but contains zero integration-specific methods.
Evidence from CI
- CI run: https://github.com/dotnet/aspire/actions/runs/23578767161
TypeScriptStarterTemplateTests(1 package) → ✅ passesPythonReactTemplateTests(2 packages) → ❌ fails- Workspace capture shows the generated
aspire.tsonly hasAspire.Hostingcapabilities
Likely Root Cause
The BundleNuGetService.RestoreAndLayoutAsync calls aspire-managed nuget restore with multiple --package arguments. Either the restore or the layout step fails silently for multi-package scenarios, resulting in a libs directory that only contains the core Aspire.Hosting.dll without integration assemblies.