Repository navigation
fix(browsers): record the alias when the build is already installed - #15694
Merged
samiyac merged 1 commit intoNov 3, 2026
Merged
Conversation
install() returned early when the requested build was already in the cache, so a buildIdAlias such as `canary` or `stable` was never written to .metadata (or kept pointing to an older build). `launch chrome@canary` then resolved to a `linux-canary` folder that does not exist. Write the alias on both the cached and the fresh install path. Skip the write when the alias is already up to date so re-running an install does not need a writable cache.
samiyac
approved these changes
Nov 3, 2026
Merged
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.
What kind of change does this PR introduce?
Bug fix.
Did you add tests for your changes?
Yes, in
packages/browsers/test/src/chrome/install.test.ts.If relevant, did you update the documentation?
Not needed.
Summary
install()returns early when the build is already in the cache, before the code that writesbuildIdAliasto.metadata. For example,npx @puppeteer/browsers install chromeand theninstall chrome@canaryboth resolve to the same Canary build. The second command prints the installed path but stores nocanaryalias, solaunch chrome@canarylooks forchrome/linux-canary/..., which does not exist. An alias that already points to an older build keeps pointing there, which also affectsnpx puppeteer browsers install chrome@stable.This writes the alias on the cached path as well. The write is skipped when the alias is already current, so re-running an install does not need a writable cache.
Does this PR introduce a breaking change?
No.
Other information
undefined, stale1.0.0.0) and pass with the fix; mocha for the Cache, uninstall, list, fileUtil, httpUtil, DefaultProvider, chrome/install, chrome/cli and chrome-data tests passes.install chrome@canarynow stores thecanaryalias andlaunch chrome@canaryresolves to the installed build;tsc -b, eslint and prettier are clean.