-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
Description
We're trying to move to the Rails 7+ default config where add_autoload_paths_to_load_path = false. However when we do that we get a NameError
NameError: uninitialized constant Primer::FormHelper (NameError)
helper Primer::FormHelper
^^^^^^^^^^^^
/app/bundle/ruby/3.4.0/gems/primer_view_components-0.48.0/lib/primer/view_components/engine.rb:56:in 'block (2 levels) in <class:Engine>'
which seems to be coming from here
https://github.com/primer/view_components/blob/main/lib/primer/view_components/engine.rb#L49-L61
removing the begin/rescue block and adding require_relative "../../../app/helpers/primer/form_helper" to the top of the file seems to fix it. but it's still confusing considering app/helpers is on the eager load config here https://github.com/primer/view_components/blob/main/lib/primer/view_components/engine.rb#L19