Skip to content

bin/importmap pin without arguments is raising an exception #317

@rafaelfranca

Description

@rafaelfranca
$ bin/importmap pin                       
/Users/rafaelfranca/.gem/ruby/3.4.4/gems/importmap-rails-2.2.2/lib/importmap/commands.rb:183:in 'Importmap::Commands#for_each_import': undefined method 'each' for nil (NoMethodError)

        response[:imports].each(&block)
                          ^^^^^
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/importmap-rails-2.2.2/lib/importmap/commands.rb:17:in 'Importmap::Commands#pin'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/thor-1.4.0/lib/thor/command.rb:28:in 'Thor::Command#run'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/thor-1.4.0/lib/thor/invocation.rb:127:in 'Thor::Invocation#invoke_command'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/thor-1.4.0/lib/thor.rb:538:in 'Thor.dispatch'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/thor-1.4.0/lib/thor/base.rb:584:in 'Thor::Base::ClassMethods#start'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/importmap-rails-2.2.2/lib/importmap/commands.rb:190:in '<main>'
        from /opt/rubies/3.4.4/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /opt/rubies/3.4.4/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
        from /Users/rafaelfranca/.gem/ruby/3.4.4/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require'
        from bin/importmap:5:in '<main>'

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