https://avo.cool logo
Hey beautiful people! I upgraded to avo
# general
e
Hey beautiful people! I upgraded to avo 3.18.2 and got the following error:
Copy code
12:09:19 web.1     | 2025-03-31 12:09:19 INFO   Rendered layout /Users/michael/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/avo-3.18.2/app/views/layouts/avo/application.html.erb (Duration: 153.3ms | GC: 0.0ms)
12:09:19 web.1     | 2025-03-31 12:09:19 INFO Completed 500 Internal Server Error in 649ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.0ms)
12:09:19 web.1     |
12:09:19 web.1     |
12:09:19 web.1     | 2025-03-31 12:09:19 ERROR

12:09:19 web.1     | ActionView::Template::Error (undefined method 'avo_dashboards' for an instance of #<Class:0x000000013ca379f0>)
12:09:19 web.1     | Caused by: NoMethodError (undefined method 'avo_dashboards' for an instance of #<Class:0x000000013ca379f0>)
12:09:19 web.1     |
12:09:19 web.1     | Information for: ActionView::Template::Error (undefined method 'avo_dashboards' for an instance of #<Class:0x000000013ca379f0>):
12:09:19 web.1     |     32:         <%= render partial: "avo/partials/navbar", locals: { resource: @resource } %>
12:09:19 web.1     |     33:         <div data-sidebar-target="mainArea" class="content-area flex-1 flex pt-16 relative <%= "sidebar-open" if @sidebar_open %>">
12:09:19 web.1     |     34:           <div class="hidden lg:flex">
12:09:19 web.1     |     35:             <%= render Avo::SidebarComponent.new sidebar_open: @sidebar_open %>
12:09:19 web.1     |     36:           </div>
12:09:19 web.1     |     37:           <div class="flex lg:hidden">
12:09:19 web.1     |     38:             <%= render Avo::SidebarComponent.new sidebar_open: false, for_mobile: true %>
12:09:19 web.1     |
12:09:19 web.1     | railties (8.0.2) lib/rails/engine/lazy_route_set.rb:99:in 'method_missing'
12:09:19 web.1     | avo-menu (3.18.2) app/components/avo/sidebar/item_switcher_component.html.erb:8:in 'Avo::Sidebar::ItemSwitcherComponent#call'
12:09:19 web.1     | view_component (3.21.0) lib/view_component/compiler.rb:98
My admin routes file:
This is my admin route file:
Copy code
# config/routes/admin.rb
admin_constraint = ->(request) { request.env['warden'].authenticate? && request.env['warden'].user.admin? }
constraints admin_constraint do
  admin_path = ENV.fetch('ADMIN_PATH') { '/_admin' }

  mount Avo::Engine, at: Avo.configuration.root_path

  scope module: 'admin', path: admin_path, as: :admin do
    resources :users, only: [] do
      resource :masquerade, only: [:show, :create]
    end
  end
  
end
scope module: 'admin', path: admin_path, as: :admin do
  # logout doesn't have admin constraint
  get 'masquerade/logout' => 'masquerades#destroy'
end
l
Hi @early-leather-2501
This is a known breaking change and is documented on our upgrade guide https://docs.avohq.io/3.0/upgrade.html#Avo's%20mounting%20point%20update
basically you need to replace
mount Avo::Engine, at: Avo.configuration.root_path
with
mount_avo
e
ay, missed that! Thanks Paul!