Fix Debug task to avoid fragile npm argument forwarding#85
Open
ayush-meghwani-28 wants to merge 1 commit into
Open
Fix Debug task to avoid fragile npm argument forwarding#85ayush-meghwani-28 wants to merge 1 commit into
ayush-meghwani-28 wants to merge 1 commit into
Conversation
The 'Debug: Excel Desktop' task ran 'npm run start -- desktop --app excel', which relies on npm forwarding the '--app' option flag across the '--' separator. On some npm versions the flag is dropped, so the command resolves to 'office-addin-debugging start manifest.xml desktop excel' (3 positionals) and fails with 'too many arguments for start. Expected 2 arguments but got 3.' Because the task aborts, the dev server never starts and Excel then reports 'failed to download a required resource.' Move the arguments into a dedicated 'start:desktop' npm script so nothing is forwarded through '--'. This preserves the desktop/--app excel intent and works reliably across npm versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
millerds
requested changes
Jul 24, 2026
millerds
left a comment
Contributor
There was a problem hiding this comment.
This doesn't scale. In general, the templates support multiple host and it's not practical to have a script command for each host and then have to adjust that when the projects are generated. This is why we use the extended arguments '--' flag. While this repo doesn't have multiple hosts . . . we like to keep the templates in sync for common thing (it's easier to maintain).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The generated
Debug: Excel DesktopVS Code task runs:This relies on npm forwarding the
--appoption flag across the--separator. On some npm versions the flag is not forwarded, so the command resolves to:That passes 3 positional arguments to
start(which accepts only<manifest-path> [platform]), producing:Because the debug task aborts before the dev server starts, Excel then reports "Add-in ... failed to download a required resource." This was hit by a customer scaffolding an Excel Custom Functions + Shared Runtime project and pressing F5.
Fix
Move the arguments into a dedicated
start:desktopnpm script so nothing is forwarded through--:package.json: add"start:desktop": "office-addin-debugging start manifest.xml desktop --app excel".vscode/tasks.json:Debug: Excel Desktopnow runs["run", "start:desktop"]This keeps the
desktop/--app excelintent, is immune to npm's--handling, and is backward compatible (identical result on old and new npm). The new script is additive — the existingstartscript andnpm startflow are unchanged.Verified locally: F5 builds, starts the dev server, and sideloads the add-in into Excel; custom functions execute.
Note on scope
The same
npm run start -- <platform> --app <host>pattern exists in the sibling template repos (Excel-Custom-Functions,Excel-Custom-Functions-JS,Excel-Custom-Functions-Shared-JS, and theOffice-Addin-TaskPane*/ React repos). Starting with this repo since it's the one in the reported issue — happy to mirror the same fix across the others once the approach is confirmed. For the multi-host TaskPane manifests, the--appvalue must be preserved (it selects which host to launch), which this script-based approach supports.