Function nil.oban_dashboard_path/3 is undefined

FInished setup with Oban, web and pro
Try to access oban web dashboard to localhost:4000/oban
This one got me an error says

Request: GET /oban
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function nil.oban_dashboard_path/3 is undefined
        nil.oban_dashboard_path(#Phoenix.LiveView.Socket<id: "phx-F0z7OBdRCZ1UOgKB", endpoint: MyAppWeb.Endpoint, view: Oban.Web.DashboardLive, parent_pid: nil, root_pid: nil, router: MyAppWeb.Router, assigns: %{__changed__: %{}, flash: %{}, live_action: :home}, transport_pid: nil, ...>, :index, :jobs)
        (oban_web 2.9.6) lib/oban/web/components/layout_component.ex:66: anonymous fn/3 in Oban.Web.LayoutComponent.tabs/1
        (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
        (oban_web 2.9.6) lib/oban/web/components/layout_component.ex:64: anonymous fn/2 in Oban.Web.LayoutComponent.tabs/1
        (oban_web 2.9.6) /Users/taekim/web/apps/web-phx/deps/oban_web/lib/oban/web/dashboard_live.ex:47: Oban.Web.DashboardLive.render/1
        (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
        (phoenix_live_view 0.18.15) lib/phoenix_live_view/diff.ex:388: Phoenix.LiveView.Diff.traverse/7
        (phoenix_live_view 0.18.15) lib/phoenix_live_view/diff.ex:139: Phoenix.LiveView.Diff.render/3
        (phoenix_live_view 0.18.15) lib/phoenix_live_view/static.ex:252: Phoenix.LiveView.Static.to_rendered_content_tag/4
        (phoenix_live_view 0.18.15) lib/phoenix_live_view/static.ex:135: Phoenix.LiveView.Static.render/3
        (phoenix_live_view 0.18.15) lib/phoenix_live_view/controller.ex:39: Phoenix.LiveView.Controller.live_render/3
        (phoenix 1.7.0) lib/phoenix/router.ex:425: Phoenix.Router.__call__/5
        (my_app 0.1.0) lib/plug/error_handler.ex:80: MyAppWeb.Router.call/2
        (my_app 0.1.0) lib/my_app_web/endpoint.ex:1: MyAppWeb.Endpoint.plug_builder_call/2
        (my_app 0.1.0) lib/plug/debugger.ex:136: MyAppWeb.Endpoint."call (overridable 3)"/2
        (my_app 0.1.0) lib/my_app_web/endpoint.ex:1: MyAppWeb.Endpoint.call/2
        (phoenix 1.7.0) lib/phoenix/endpoint/sync_code_reload_plug.ex:22: Phoenix.Endpoint.SyncCodeReloadPlug.do_call/4
        (plug_cowboy 2.6.0) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2

in config.exs

if Mix.env() in [:dev, :test] do
    import Phoenix.LiveDashboard.Router
    import Oban.Web.Router

    scope "/" do
      pipe_through :browser

      oban_dashboard("/oban")
    end
  end

version info

oban 2.14.2
oban_pro 0.13.2
oban_web 2.9.6

elixir 1.14.2-otp-25
erlang 25.1.2

phoenix 1.7

Anyone has any idea?

Be sure you’re enabling helpers for the router in Phoenix 1.7:

use Phoenix.Router, helpers: true

The current Oban Web supports Phoenix 1.6 and 1.7, so it still makes use of the legacy route helpers.

1 Like