ash-project/ash_admin

Templates broken in LiveView 0.20

Closed this issue · 7 comments

Describe the bug

The admin pages render unresolved markup, while the developer console spews errors "only HTML element tags are allowed at the root of components.

admin-template-errors

To Reproduce

  1. Follow the steps in Get Started with Ash and Phoenix.
  2. Follow the steps in the ash_admin README to add Admin pages.
  3. Start server and visit any admin page.

The problem is clearly introduced withphoenix_live_view version 0.20, as it disappears with a downgrade using deps config {:phoenix_live_view, "0.19.5"}.

I won't have time to look at this in the near future, anyone who does it would be greatly appreciated. It essentially boils down to wrapping some components in <div (or something along those lines)

I've tried some things, but it seems it is not as simple as adding some div wrappers.

It is probably obvious from the error messages and the Phoenix LiveView changelog, but this seems to related to the new "heex debug annotations".

I've tried to have a quick look at what exactly makes ash_admin break with the annotations enabled, but haven't figured it out yet.

I can confirm this problem occurs with {:ash_admin, "~> 0.9.5"} and {:phoenix_live_view, "~> 0.20.1"}.

I can also confirm that the problem goes away when I configure my project to not use the new debug annotations (config :phoenix_live_view, :debug_heex_annotations, false and I then recompile ash_admin with mix deps.compile --force ash_admin. With the setting disabled, the HTML comments are no longer added and the LiveViewJS error doesn't occur.

Thanks for finding the workaround @juhalehtonen. At least that unblocks people while we're looking at a fix.

This is interesting. Running mix dev in ash_admin doesn't have this same issue after updating all of the dependencies. Does updating all of your dependencies solve this issue?

okay I can definitely see this is an issue. Looking into it!

@zachdaniel - it only happens when adding the config to enable heex annotations, eg. config :phoenix_live_view, :debug_heex_annotations, true in config.exs