Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 22, 2025

The AddJavaScriptApp API lacks the args parameter present in the deprecated AddNpmApp, breaking migration workflows for users who passed command-line arguments to scripts.

Changes

aspire-13.mdx

  • Added "Passing arguments to scripts" section documenting the missing parameter and workaround
  • Added migration note in "Obsolete APIs" section linking to detailed guidance

add-aspire-existing-app.mdx

  • Added note in JavaScript section explaining the missing parameter with example

Migration Pattern

Before (Aspire 9.x):

builder.AddNpmApp("hasura-console", "../Web/ClientApp", 
    scriptName: "hasura:console", 
    args: ["--no-browser"])

After (Aspire 13.0):

// package.json
{
  "scripts": {
    "hasura:console": "hasura console --no-browser"
  }
}
builder.AddJavaScriptApp("hasura-console", "../Web/ClientApp", 
    runScriptName: "hasura:console");

The workaround keeps script configuration in package.json, making it discoverable and runnable outside Aspire.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/CommunityToolkit/Aspire
    • Triggering command: /usr/local/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire
    • Triggering command: /usr/local/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/dotnet/aspire-samples
    • Triggering command: /usr/local/bin/node node ./scripts/update-github-stats.js (http block)
  • https://api.github.com/repos/microsoft/aspire.dev
    • Triggering command: /usr/local/bin/node node ./scripts/update-github-stats.js (http block)
  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Document args parameter missing from AddJavaScriptApp API</issue_title>
<issue_description>## Documentation issue: args parameter for AddJavaScriptApp API

Related to dotnet/aspire#13087:

The documentation for the AddJavaScriptApp API does not mention the absence of support for the args parameter, which was present in AddNpmApp in Aspire 9. Developers may be confused when trying to migrate code and find that args is missing, leading to workarounds or confusion.

Background

In Aspire 9, the following was possible:

builder.AddNpmApp("hasura-console", "../Web/ClientApp", scriptName: "hasura:console", args: ["--no-browser"])

In Aspire 13:

// builder.AddJavaScriptApp("hasura-console", "../Web/ClientApp", runScriptName: "hasura:console", args: ["--no-browser"]) // args param not found
builder.AddJavaScriptApp("hasura-console", "../Web/ClientApp", runScriptName: "hasura:console") // must omit args

Proposal

Update documentation for AddJavaScriptApp to clearly call out the absence of the args parameter and, if possible, recommend workarounds:

  • Show how developers can create a script in package.json for custom arguments.
  • Clarify migration steps from AddNpmApp to AddJavaScriptApp regarding args.

Impact

This will help clarify the API migration process for users and avoid confusion.


See original feature request and workaround details: dotnet/aspire#13087</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update documentation for AddJavaScriptApp API args parameter Document missing args parameter in AddJavaScriptApp API Nov 22, 2025
Copilot AI requested a review from IEvangelist November 22, 2025 02:56
Copilot finished work on behalf of IEvangelist November 22, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document args parameter missing from AddJavaScriptApp API

2 participants