Phoenix 1.7 rc 1 alias in components not seen

in the new setup with components accessed from a controller

from the docs Components and HEEx Templates β€” Phoenix v1.7.0-rc.0

Phoenix assumes a strong naming convention from controllers to views to the templates they render. PageController requires a PageHTML to render templates in the lib/hello_web/controllers/page_html/ directory.

With all this setup alias declared in page_html.ex are not seen inside the page_html/* templates.

if completely prefixed inside embedded templates, all is ok, but with aliases placed in the page_html.ex it does not work

in app_web.ex

def controller do
quote do
use Phoenix.Controller, namespace: AppWeb,
formats: [:html, :json, :xlsx, :pdf],
layouts: [html: AppWeb.Layouts]

  import Plug.Conn

end

end

the app was converted from 1.6 and views.
While in a newly generated app aliases are seen, it’s not he case in this converted app.

I was wondering what could cause that since the template is reached and the page is shown ok if not using aliases

1 Like

the reason is that

embed_templates line must appear after alias lines

3 Likes