Guard convertToSingleHost against deeply nested JSON config files#504
Merged
millerds merged 1 commit intoJul 6, 2026
Conversation
Contributor
Author
@microsoft-github-policy-service agree company="Microsoft" |
9dd50fe to
2f10b89
Compare
millerds
approved these changes
Jul 6, 2026
Contributor
|
/azurepipeline run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Note that this only fixes this one template repo. There are several others (including excel-custom-functions-js, excel-custom-functions-shared*, and office-addin-taskpane* respos). |
This was referenced Jul 7, 2026
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.
Thank you for your pull request! Please provide the following information.
Change Description:
convertToSingleHost.jsreads launch.json / package.json / tasks.json, modifies them, and writes them back with JSON.stringify(content, null, 2). Node's JSON.stringify is recursive, so a config file containing extremely deeply nested JSON causes an opaque "RangeError: Maximum call stack size exceeded" (JSON.parse itself succeeds since it is iterative).This PR wraps the write-back serialization in a small helper that catches that RangeError and rethrows a clear, actionable message naming the affected file, instead of an opaque stack overflow. Normal template content is unaffected.
Do these changes impact any npm scripts commands (in package.json)? (e.g., running 'npm run start')
If Yes, briefly describe what is impacted.
=> No
Do these changes impact VS Code debugging options (launch.json)?
If Yes, briefly describe what is impacted.
=> No
Do these changes impact template output? (e.g., add/remove file, update file location, update file contents)
If Yes, briefly describe what is impacted.
=> No
Do these changes impact documentation? (e.g., a tutorial on https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)
If Yes, briefly describe what is impacted.
=> No
If you answered yes to any of these please do the following:
> Include 'Rick-Kirkham' in the review
> Make sure the README file is correct
Validation/testing performed: