Skip to content

bin/importmap outdated fails when using nested package path (e.g. photoswipe/lightbox) #321

@Xeross99

Description

@Xeross99

bin/importmap outdated fails when using nested package path (e.g. photoswipe/lightbox)

Steps to reproduce:

  1. Pin a nested ESM path from a package:
bin/importmap pin photoswipe/lightbox

This produces:

Pinning “photoswipe/lightbox” to vendor/javascript/photoswipe/lightbox.js via download from https://ga.jspm.io/npm:photoswipe@5.4.4/dist/photoswipe-lightbox.esm.js

  1. Run:
bin/importmap outdated

Actual result:

/Users/xeross/.gem/ruby/3.4.7/gems/importmap-rails-2.2.2/lib/importmap/npm.rb:95:in 'Importmap::Npm#get_json': Unexpected error response 404: "version not found: lightbox" (Importmap::Npm::HTTPError)


Importmap attempts to look up “lightbox” as an NPM package, instead of resolving it as a subpath of “photoswipe”. Pin handles this correctly, but outdated breaks because it splits the name incorrectly and treats the subpath as a separate package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions