Calling mix phx.new --live newproject creates a project with the following dependency definition for phoenix_live_dashboard.
defp deps do
[
...
{:phoenix_live_dashboard, "~> 0.3 or ~> 0.2.9"},
...
]
end
This result in a broken live dashboard. If I replace the dependency definition with "~> 0.2.9" everything works fine.
The error I see in my browser is:
[error] #PID<0.622.0> running NewProjectWeb.Endpoint (connection #PID<0.621.0>, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
** (ArgumentError) no action :home for NewProjectWeb.Router.Helpers.live_dashboard_path/2. The following actions/clauses are supported:
live_dashboard_path(conn_or_endpoint, :page, params \\ [])
live_dashboard_path(conn_or_endpoint, :page, node, page, params \\ [])
live_dashboard_path(conn_or_endpoint, :page, page, params \\ [])
mix phx.new should create a mix.exs file with the working dependency definition.
I can reproduce this issue. If you don't need the Live Dashboard, you can use the --no-dashboard option. Or, if you want a simple workaround, remove the line from root.html.leex:19 and then access the dashboard at http://localhost:4000/dashboard.
Thanks for the hint the command line flag and the HTML file. I also got another solution/workaround on Elixir forum.
https://elixirforum.com/t/phx-new-live-generates-a-broken-project/35179/3?u=oliverandrich
It has been fixed with a new dashboard release. Thanks!
Most helpful comment
It has been fixed with a new dashboard release. Thanks!