lookbook-hq/lookbook

ActionView::Template::Error occurs when trying to render a template file with a partial

Closed this issue · 5 comments

Describe the bug

The following error occurred when trying to render a template with partial as in render template: 'articles/xxx', assigns: { xxx: }.

ActionView::Template::Error
Missing partial lookbook/articles/_article with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jbuilder]}.

Missing partial lookbook/articles/_article with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jbuilder]}.

Searched in:
  * "/path/to/xxxx/projects/personal/LookBookSample2/test/components/previews"
  * "/path/to/xxxx/projects/personal/LookBookSample2/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/templates"
  * "/path/to/xxxx/projects/personal/LookBookSample2/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/view_component-3.7.0/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/turbo-rails-1.5.0/app/views"
  * "/path/to/xxxx/projects/personal/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionmailbox-7.1.2/app/views"

I think the problem is that it has a lookbook namespace instead of articles/_articles.
I tried to read the actionview/actionpack code based on stacktrace to create a PR if possible, but I got to the point where I thought the problem might be around the initialization of the lookup_context.
However, the initialization process is so complex that I could not figure out where to fix it, so I created an issue.

To Reproduce

  1. bin/rails generate scaffold Article title:string body:text
# app/views/articles/show.html.erb
<div class="mx-auto md:w-2/3 w-full flex">
  <div class="mx-auto">
    <% if notice.present? %>
      <p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
    <% end %>

    <%= render @article %>

    <%= link_to "Edit this article", edit_article_path(@article), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
    <div class="inline-block ml-2">
      <%= button_to "Destroy this article", article_path(@article), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
    </div>
    <%= link_to "Back to articles", articles_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
  </div>
</div>
# test/components/previews/articles/show_preview.rb
class Articles::ShowPreview < Lookbook::Preview
  def default
    article = Article.new(id: 1, title: 'title', body: 'beody')
    render template: 'articles/show', assigns: { article: }
  end
end
  1. See error http://localhost:3000/lookbook/inspect/articles/show/default

Expected behavior

When redering a partial, it should look for articles/_articles instead of under the lookbook directory, such as lookbook/articles/_articles.

Screenshots

image

Full stack trace

/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/path_set.rb:42:in `find'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/lookup_context.rb:131:in `find'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/partial_renderer.rb:264:in `find_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/partial_renderer.rb:231:in `render'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/object_renderer.rb:16:in `render_object_with_partial'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/object_renderer.rb:21:in `render_object_derive_partial'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/renderer.rb:96:in `render_partial_to_object'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/renderer.rb:55:in `render_partial'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/helpers/rendering_helper.rb:44:in `render'
/path/to/xxxx/LookBookSample2/app/views/articles/show.html.erb:7:in `_app_views_articles_show_html_erb___1326443331578832732_26220'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/base.rb:264:in `public_send'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/base.rb:264:in `_run'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/template.rb:261:in `block in render'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:208:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/template.rb:549:in `instrument_render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/template.rb:249:in `render'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `block in instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/template_renderer.rb:80:in `render_with_layout'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/template_renderer.rb:11:in `render'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/renderer.rb:63:in `render_template_to_object'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/rendering.rb:135:in `block in _render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/base.rb:291:in `in_rendering_context'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/rendering.rb:134:in `_render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/streaming.rb:256:in `_render_template'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/rendering.rb:121:in `render_to_body'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/rendering.rb:45:in `render_to_string'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rendering.rb:147:in `render_to_string'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/lib/lookbook/preview_controller_actions.rb:24:in `render_scenario_to_string'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/base.rb:224:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rendering.rb:165:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:110:in `run_callbacks'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/callbacks.rb:258:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rescue.rb:25:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `block in instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/base.rb:160:in `process'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/rendering.rb:40:in `process'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/targetable_concern.rb:99:in `block in inspector_data'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/targetable_concern.rb:98:in `map'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/targetable_concern.rb:98:in `inspector_data'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/with_panels_concern.rb:18:in `block in main_panels'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/with_panels_concern.rb:17:in `map'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/concerns/lookbook/with_panels_concern.rb:17:in `main_panels'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/lookbook-2.2.0/app/controllers/lookbook/inspector_controller.rb:14:in `show'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/base.rb:224:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rendering.rb:165:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:110:in `run_callbacks'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/callbacks.rb:258:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/rescue.rb:25:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `block in instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/notifications.rb:206:in `instrument'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/abstract_controller/base.rb:160:in `process'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionview-7.1.2/lib/action_view/rendering.rb:40:in `process'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal.rb:227:in `dispatch'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_controller/metal.rb:309:in `dispatch'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:51:in `block in serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:124:in `each'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:124:in `find_routes'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:32:in `serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/route_set.rb:882:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/engine.rb:529:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/railtie.rb:226:in `public_send'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/railtie.rb:226:in `method_missing'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/mapper.rb:22:in `block in <class:Constraints>'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/mapper.rb:51:in `serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:51:in `block in serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:124:in `each'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:124:in `find_routes'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/journey/router.rb:32:in `serve'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/routing/route_set.rb:882:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/static.rb:25:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/static.rb:161:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/tempfile_reaper.rb:20:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/etag.rb:29:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/conditional_get.rb:31:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/head.rb:15:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/http/permissions_policy.rb:36:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/http/content_security_policy.rb:33:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in `context'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/cookies.rb:689:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/migration.rb:654:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:101:in `run_callbacks'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/web-console-4.2.1/lib/web_console/middleware.rb:132:in `call_app'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/web-console-4.2.1/lib/web_console/middleware.rb:28:in `block in call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/web-console-4.2.1/lib/web_console/middleware.rb:17:in `catch'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/web-console-4.2.1/lib/web_console/middleware.rb:17:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/rack/logger.rb:37:in `call_app'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/rack/logger.rb:24:in `block in call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/tagged_logging.rb:39:in `tagged'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/tagged_logging.rb:135:in `tagged'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/broadcast_logger.rb:240:in `method_missing'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/rack/logger.rb:24:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/request_id.rb:28:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/method_override.rb:28:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/runtime.rb:24:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/server_timing.rb:59:in `block in call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/server_timing.rb:58:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/static.rb:25:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/sendfile.rb:114:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.2/lib/action_dispatch/middleware/host_authorization.rb:141:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/engine.rb:529:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/configuration.rb:272:in `call'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/request.rb:100:in `block in handle_request'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/request.rb:99:in `handle_request'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/server.rb:443:in `process_client'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/server.rb:241:in `block in run'
/path/to/xxxx/LookBookSample2/vendor/bundle/ruby/3.2.0/gems/puma-6.4.0/lib/puma/thread_pool.rb:155:in `block in spawn_thread'

Version numbers

Please complete the following information:

Lookbook: 2.2.0
ViewComponent: -
Rails: 7.1.2
Ruby: 3.2.1p31

Additional context

The following is a sample project that is actually in error.
https://github.com/vividmuimui/LookBookSample/tree/report-issue
https://github.com/vividmuimui/LookBookSample/blob/report-issue/test/components/previews/articles/show_preview.rb

Hey @mpg-takahiro-koyama,

I had a similar issue recently and opened PR #606. I checked it with your case and it looks fine.

You can follow these steps in case you want to reproduce it:

  1. Install the lookbook version from my PR.
gem "lookbook", github: "liram11/lookbook", branch: "fix-partial-rendering"
  1. Set the preview_disable_action_view_partial_prefixes Lookbook parameter to true in your Rails config:
#./config/environments/development.rb
config.lookbook.preview_disable_action_view_partial_prefixes = true
  1. Open the preview.

And thanks for the detailed report.

@liram11
Thank you for the guidance! I followed the steps you outlined and I was able to display lookbook without any errors. 🎉

Cool, thanks for double-checking it 👍

The PR #606 that addressed this issue has been merged, and I have confirmed that it works correctly in the main branch. Therefore, I am closing this issue.
@liram11 Thank you! 😄

@mpg-takahiro-koyama I've just released v2.3.0 that contains @liram11's fix for this issue. Thanks for reporting it and for confirming the fix works for you!