tfwright / live_admin

Low-config admin UI for Phoenix apps, built on LiveView
MIT License
251 stars 22 forks source link

Phoenix 1.7 - function nil.home_path/2 is undefined #19

Closed blutack closed 1 year ago

blutack commented 1 year ago

Note, this only affects the branch in https://github.com/tfwright/live_admin/pull/12 as Phoenix 1.7 requires LV 0.18 but I'm putting it here in case that gets merged.

Phoenix 1.7 ships with router helpers disabled by default.

The default layout uses a router helper here: https://github.com/tfwright/live_admin/blob/cd9159425416942faf2f177e5fc01f0f61c4b7b2/lib/live_admin/layout.html.heex#L23

Therefore, with default 1.7 config we get an UndefinedFunctionError.

As a temporary workaround, update myapp_web.ex and change use Phoenix.Router, helpers: false to use Phoenix.Router, helpers: true.

Other than that it seems that everything works well with 1.7!

tfwright commented 1 year ago

Thanks for the report! Since this only affects a currently issue though, let's move this discussion there.