tfwright / live_admin

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

Can't compile with :phoenix_html version 4.0 #98

Closed tmaszk closed 9 months ago

tmaszk commented 9 months ago

Thanks for creating and sharing live_admin. It is very useful!

When upgrading the dependencies of my project, specifically :phoenix_html to 4.0, the live_admin package cannot compile.

To Reproduce

  1. include packages :live_admin and :phoenix_html, "~> 4.0" in a project
  2. run mix compile
  3. See error included below

Expected behavior The project to compile and run

Screenshots Here's the compiler error message:

==> live_admin
Compiling 23 files (.ex)

== Compilation error in file lib/live_admin/components/resource/form/map_input.ex ==
** (RuntimeError) use Phoenix.HTML is no longer supported in v4.0.

To keep compatibility with previous versions, add {:phoenix_html_helpers, "~> 1.0"} to your mix.exs deps
and then, instead of "use Phoenix.HTML", you might:

    import Phoenix.HTML
    import Phoenix.HTML.Form
    use PhoenixHTMLHelpers

    (phoenix_html 4.0.0) expanding macro: Phoenix.HTML.__using__/1
    lib/live_admin/components/resource/form/map_input.ex:3: LiveAdmin.Components.Container.Form.MapInput (module)
    (elixir 1.15.7) expanding macro: Kernel.use/1
    lib/live_admin/components/resource/form/map_input.ex:3: LiveAdmin.Components.Container.Form.MapInput (module)

Environment:

Additional context phoenix_html changelog

tfwright commented 9 months ago

Thanks for reporting this! For now I have just added the working version of Phoenix.HTML to the deps, that should at least clarify the requirement. I will look into adding support for 4.0 when I have time, or feel free to open a PR!

tmaszk commented 9 months ago

Thanks. I submitted a PR. I've been testing the same changes with my project.