Skip to content

Gem using ViewComponent breaks from changes to ViewComponent::Base #1464

@pJeyakumar

Description

@pJeyakumar

Steps to reproduce

  1. Clone Matey Repository
  2. Install Docker
  3. Open Local Repository in Remote Container using Docker
  4. Change view_component gem in spec/sample folder to ver. 2.66.0 (in line 224)
  5. Run the sample application by following the Development steps here

Expected behavior

  • The sample application should work on localhost:3000 without any issues.

Actual behavior

  • A NoMethodError: undefined method `config' for nil:NilClass
NoMethodError: undefined method `config' for nil:NilClass

          /(.*#{Regexp.quote(Rails.application.config.view_component.view_component_path)})|(\.rb)/, ""
                                              ^^^^^^^
/usr/local/bundle/gems/view_component-2.66.0/lib/view_component/base.rb:499:in `inherited'
/usr/local/bundle/bundler/gems/matey-0da56ccf8b95/app/components/application_component.rb:4:in `<main>'
/usr/local/bundle/bundler/gems/matey-0da56ccf8b95/lib/matey.rb:5:in `require_relative'
/usr/local/bundle/bundler/gems/matey-0da56ccf8b95/lib/matey.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/bundle/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler/runtime.rb:55:in `each'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler/runtime.rb:55:in `block in require'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler/runtime.rb:44:in `each'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler/runtime.rb:44:in `require'
/usr/local/bundle/gems/bundler-2.3.19/lib/bundler.rb:188:in `require'
/app/config/application.rb:7:in `<main>'
/app/rakefile:4:in `require_relative'
/app/rakefile:4:in `<main>'
/usr/local/bundle/gems/railties-7.0.3.1/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/usr/local/bundle/gems/railties-7.0.3.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/usr/local/bundle/gems/railties-7.0.3.1/lib/rails/command.rb:51:in `invoke'
/usr/local/bundle/gems/railties-7.0.3.1/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:4:in `<main>'

System configuration

Rails version:
rails (7.0.2.3)

Ruby version:
ruby-3.1.1

Gem version:
2.53.0 -> 2.66.0

  • However, we have confirmed that the issue comes from the jump to ver 2.66.0 as we had the view_component gem working amazingly in ver 2.65.0, but as soon as we updated it, we started having the issues!

Metadata

Metadata

Assignees

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