Skip to content

Bundle mode: SDK codegen doesn't include integration packages when aspire.config.json has multiple packages #15603

@davidfowl

Description

@davidfowl

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.JavaScript only) generates a correct SDK with addExpressApp, addViteApp, etc. ✅
  • Multiple packages fails: The Python starter template (Aspire.Hosting.JavaScript + Aspire.Hosting.Python) generates a SDK with only core Aspire.Hosting functions — 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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions