Skip to content

fix(@angular/cli): handle missing package manager during analytics initialization#32929

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:analytics/safe-pm-version
Open

fix(@angular/cli): handle missing package manager during analytics initialization#32929
clydin wants to merge 1 commit intoangular:mainfrom
clydin:analytics/safe-pm-version

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 2, 2026

Wrap getVersion() call in try-catch to prevent a crash during analytics setup when the package manager is not available.

@clydin clydin added target: patch This PR is targeted for the next patch release and removed area: @angular/cli labels Apr 2, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces error handling when retrieving the package manager version for analytics by wrapping the call in a try-catch block. A review comment points out that the version is now fetched even when analytics are disabled, which introduces unnecessary performance overhead by spawning a sub-process needlessly; it is recommended to move this logic inside the conditional check for the user ID.

…itialization

Wrap getVersion() call in try-catch to prevent a crash during analytics setup when the package manager is not available.
@clydin clydin force-pushed the analytics/safe-pm-version branch from 97ffd2d to 8d8a710 Compare April 2, 2026 14:46
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant