Skip to content

Aliased dependencies are not linked correctly #2010

@ericcornelissen

Description

@ericcornelissen

Describe the bug

The npmx interface links to the wrong package when a package specifies a dependency through an alias (e.g., "foo": "npm:bar@1.2.3" in package.json) in the "Dependencies" section of the sidebar. See for example string-width-cjs npm:string-wi... in the preview below:

Image

which currently links to https://npmx.dev/package/string-width-cjs but should link to https://npmx.dev/package/string-width per https://npmx.dev/package-code/@isaacs/cliui/v/8.0.2/package.json#L53.

Additional context

Example:

Logs

n/a

Footnotes

  1. this appears to be a quite recent change because I definitely remember them linking to the alias-named package not too long ago. See also https://snyk.io/blog/exploring-extensions-of-dependency-confusion-attacks-via-npm-package-aliasing/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backServer, DatafrontFrontend, Design

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions