Fix: unregistered print.browser.useAlternate configuration error on startup#432
Draft
Copilot wants to merge 2 commits into
Draft
Fix: unregistered print.browser.useAlternate configuration error on startup#432Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: PeterWone <5498936+PeterWone@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error for print.browser.useAlternate configuration
Fix: unregistered print.browser.useAlternate configuration error on startup
Mar 10, 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.
Users who had passed through an intermediate version of the extension had
print.browser.useAlternateand/orprint.browser.alternateBrowserPathwritten to theirsettings.json. These keys were removed frompackage.jsonin a later refactoring, causing VS Code to error on every startup when encountering them.Changes
package.json: Registerprint.browser.useAlternate(boolean) andprint.browser.alternateBrowserPath(string) as deprecated settings withdeprecationMessagepointing to the current key names. This prevents VS Code from rejecting reads/writes to these keys on behalf of users still carrying them.src/settings-migration.ts:"alternateBrowser"now maps directly to"alternateBrowser.enable"(was"browser.useAlternate", an intermediate unregistered step); same for"browserPath"→"alternateBrowser.path".getSourceKeys(): previously excluded any key that was itself a migration target — this silently skippedbrowser.useAlternateandbrowser.alternateBrowserPath, leaving them stranded in settings. Now returns all non-self-referential keys so intermediate keys are also migrated and cleaned up.resolveMigrationChain(): no longer needed since all mappings are now direct.try/catchso a failed cleanup of an unregistered old key doesn't roll back a successful write to the new key.src/extension.ts: Fix typo insetAlternateBrowser()—"print.alternatBrowser"→"print.alternateBrowser"(missingewould write to an unregistered key).Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.