No "root" html template defined for ... (the module does not exist)

Gist example recompile exception · GitHub

Runtime (works)

  1. mix phx.server
  2. Write an incorrect class <body class={class(["bg-wh ite", "dark:bg-gray-900"])}> and it will raise an error in runtime (as expected).
  3. Fix the class back, the page will reload (as expected).

Mix compile (doesn’t work)

  1. mix phx.server is not running.
  2. Write an incorrect class <body class={class(["bg-wh ite", "dark:bg-gray-900"])}>.
  3. Start mix phx.server, and it will raise an error. (as expected)
  4. Fix the class back to <body class={class(["bg-white", "dark:bg-gray-900"])}>.
  5. Run mix phx.server, and only PhoenixAssetPipelineExampleWeb.Layout will be recompiled, and you will get an error:

no "root" html template defined for PhoenixAssetPipelineExampleWeb.Layouts (the module does not exist).

1 Like

On mobile so can’t try the code provided. Two questions though:

  1. Where is the error at 2. shown? Iex console or…?
  2. Is there a LSP server running?

Not related to LSP

mix phx.server in cmd

no “root” html template defined for PhoenixAssetPipelineExampleWeb.Layouts (the module does not exist). in runtime

What is the first ‘it’ in point two or is this the same ‘it’ as in 3 (phx.server)?

same raise, corrected in issue

Elixir 1.18.1 fixes issue