Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chrismccord
Last active December 22, 2023 19:37
Show Gist options
  • Star 50 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save chrismccord/00a6ea2a96bc57df0cce526bd20af8a7 to your computer and use it in GitHub Desktop.
Save chrismccord/00a6ea2a96bc57df0cce526bd20af8a7 to your computer and use it in GitHub Desktop.

Upgrading from Phoenix v1.6.x to v1.7.0

Most of the new features and requirements for v1.7 are optional and many folks will simpy be able to bump their mix.exs version and compile without issue, though a few warnings will be reported.

Pre-requirements

Before upgrading Phoenix itself to v1.7, we recommend first updating some Phoenix dependencies in mix.exs: phoenix_view (add it if missing), phoenix_live_view (if you were explictly using LiveView before), and phoenix_live_dashboard.

def deps do
  [
    {:phoenix_view, "~> 2.0"},
    {:phoenix_live_view, "~> 0.18.18"},
    {:phoenix_live_dashboard, "~> 0.7.2"},
    ...
  ]
end

If you are currently using Phoenix LiveView v0.17 or earlier, please read and follow the LiveView CHANGELOG before continuing.

Update to Phoenix v1.7

With dependencies updated, updating to Phoenix v1.7 should be as simple as bumping its requirement:

def deps do
  [
    {:phoenix, "~> 1.7.0"},
    ...
  ]
end

Remove the :phoenix and :gettext compilers from your mix.exss project/0 :compilers configuration

These are longer necessary on Elixir v1.11+:

  def project do
    [
-     compilers: [:phoenix, :gettext] ++ Mix.compilers(),
    ]
  end

Update your .formatter.exs

To support the latest Phoenix.LiveView HTML formatter and declarative assigns macros, update your .formatter.exs as follows with the Phoenix.LiveView.HTMLFormatter plugin:

[
  import_deps: [:ecto, :ecto_sql, :phoenix],
  subdirectories: ["priv/*/migrations"],
  plugins: [Phoenix.LiveView.HTMLFormatter],
  inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
]

Optional Updates

The remaining updates are optional and only necessary if you intend to make use of the new verified routes, or phx.gen.html|live|auth generators in an existing application. The generators follow new conventions and make use of the new function component approach to building templates. While these changes are a big step forward for new applications, it probably makes sense to maintain your current application conventions and skip these steps for established, large 1.6 applications.

(optional) Upgrade to Elixir v1.14.0

While not a hard requirement, Elixir v1.14.0 provides new compiler features to support proper warnings for the new Phoenix.VerifiedRoutes feature as well as Phoenix LiveView 0.18's new declarative assigns.

(optional) Update your app to support Phoenix.VerifiedRoutes

You can read more about verified routes here

Add the following lines to your lib/app_web.ex:

+ def static_paths, do: ~w(assets fonts images favicon.ico robots.txt)
  
  def controller do
    quote do
      use Phoenix.Controller, namespace: DemoWeb

      import Plug.Conn
      import DemoWeb.Gettext

+     unquote(verified_routes())
    end
  end    

  defp view_helpers do
    quote do
      ...
+     unquote(verified_routes())
    end
  end
  
+ def verified_routes do
+   quote do
+     use Phoenix.VerifiedRoutes,
+       endpoint: DemoWeb.Endpoint,
+       router: DemoWeb.Router,
+       statics: DemoWeb.static_paths()
+   end
+ end

Next, update your lib/app_web/endpoint.ex's Plug.Static to reference the static_paths function:

  plug Plug.Static,
    at: "/",
    from: :app,
    gzip: false,
-   only: ~w(assets fonts images favicon.ico robots.txt)
+   only: AppWeb.static_paths()

Lastly, update your test/support/conn_case.ex to use verified routes:

  using do
    quote do
      # The default endpoint for testing
      @endpoint DemoWeb.Endpoint

+     use AppWeb, :verified_routes

      # Import conveniences for testing with connections
      import Plug.Conn
      import Phoenix.ConnTest
      import AppWeb.ConnCase
    end
  end

You're now set up to use ~p throughout your web and test stack. Enjoy!

(optional) Migrate from Phoenix.View to Phoenix.Component

Phoenix v1.6 used Phoenix.View to render templates, Phoenix v1.7 defaults to Phoenix.Component. Phoenix.View is not deprecated and it is still supported. Old applications can depend on it as they prefer. However, if you want to migrate to Phoenix.Component, we have written helpful steps in the Phoenix.View documentation.

@jfpedroza
Copy link

Nice. I made a script that replaces 95% of them. I'll try the task with the remaining. Thanks.

@Sareon
Copy link

Sareon commented Mar 10, 2023

Hello! Does anybody know why the link/2 fucnction stopped working ((CompileError) lib/appname/controllers/name_html/index.html.heex:4: undefined function link/2) on the latest version of phoenix/elixir. It seems that before 1.7 Phoenix automatically imported Phoenix.HTML.Link into my templates, but now it doesn't.
Thanks in advance

@josevalim
Copy link

@Sareon assuming you are using a new v1.7 app, the function component is the way to go: https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#link/1

@TamLyNhat
Copy link

TamLyNhat commented Mar 11, 2023

Hello everyone,
I am not sure I am asking the right channel or not, but I am facing the issue when upgrading phoenix 1.6.17 to 1.7, I did Pre-requirements as above and run mix deps.get, then changed phoenix version to 1.7 and run mix deps.get again, it reported:

$ mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.031s
Because "your app" depends on "phoenix empty" which doesn't match any versions, version solving failed.
** (Mix) Hex dependency resolution failed

deps function on mix.exs:

  defp deps do
    [
      {:phoenix, "~> 1.7"},
      {:phoenix_view, "~> 2.0"},
      {:phoenix_ecto, "~> 4.4"},
      {:phoenix_html, "~> 3.0"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_view, "~> 0.18.17"},
      {:floki, ">= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~> 0.7.2"},
      {:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
      {:telemetry_metrics, "~> 0.6"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.18"},
      {:fun_app, in_umbrella: true},
      {:jason, "~> 1.2"},
      {:plug_cowboy, "~> 2.5"},
      {:vega_lite, "~> 0.1.5"}
    ]
  end

Note: I am using an umbrella project, I have tried to create a normal project without umbrella and upgraded phoenix to 1.7, and it works well.
Do you have any idea about that ?

Thanks for your support.

@josevalim
Copy link

josevalim commented Mar 14, 2023

@TamLyNhat this happens because one of your non-Hex dependencies (such as a git dependency or an umbrella application) has a conflicting requirement on Phoenix, in a way that Hex (the package manager) only sees an empty set of available Phoenix packages. Check the :fun_app in your umbrella and see if it depends on Phoenix and make sure to bump it there too.

Also, consider using ElixirForum for questions, the response time of the community there is likely quicker.

@Cellane
Copy link

Cellane commented Mar 16, 2023

How can I continue using old view templates for existing endpoints while going forward with the new co-located pure Elixir modules for new endpoints?

If I create OrganizationJSON module alongside OrganizationController without any further change, the endpoint fails with ** (ArgumentError) no "show" json template defined for OviceWeb.Api.V4.OrganizationView.

If I alter OviceWeb to specify formats (use Phoenix.Controller, namespace: OviceWeb, formats: [:html, :json]), then all the existing endpoints fail instead by not being able to find the existing JSON views.

@JonRowe
Copy link

JonRowe commented Mar 16, 2023

@Cellane did you add phoenix_view as a depedency?

@Cellane
Copy link

Cellane commented Mar 16, 2023

@JonRowe I did, but even with the dependency, the only way I found so far to make both approaches work is to do the following changes:

  1. Add new __using__ clause to lib/ovice_web.ex:
  defmacro __using__(controller: :functional) do
    apply(__MODULE__, :controller, [:functional])
  end
  1. Alter the existing def controller do like so:
  def controller(variant \\ nil) do
    quote do
      formats =
        if unquote(variant) == :functional,
          do: [:html, :json],
          else: [html: "View", json: "View"]

      use Phoenix.Controller,
        namespace: OviceWeb,
        formats: formatsend
  end
  1. After that, existing controllers continue working with use OviceWeb, :controller while new controllers can use OviceWeb, controller: :functional and use render(conn, :show,…) that calls co-located OrganizationJSON module

@josevalim
Copy link

@Cellane you are right in your approach, you will have to define the controller slightly different. My only suggestion is to, instead of use MyAppWeb, controller: :functional, I would do use MyAppWeb, :format_controller or something of sorts.

@superchris
Copy link

A thing I ran into that I hadn't seen: I was getting undefined function form/1 in my view modules. Turns out I needed to import Phoenix.Component in the view_helpers function of my web module

@goto-engineering
Copy link

If you are using Surface, do NOT remove the [:surface] compiler from your mix.exs or it won't compile all of your JS. I got an error:

** (Mix) `mix esbuild default --minify` exited with 1
The command '/bin/sh -c mix assets.deploy' returned a non-zero code: 1

Just putting back the [:surface] compiler fixed it.

@goto-engineering
Copy link

goto-engineering commented Apr 25, 2023

I followed the Verified Routes instructions above, and I can put links to verified routes in that do work.
But they still warn me that no routes at all can be found. But they work. What gives?

warning: no route path for Web.Router matches "/search"
  lib/web/live/home_live.ex:157

This is not correct, the route definitely exists.

λ mix phx.routes | grep " /search"
              search_page_path  GET   /search                                     Web.SearchPageLive :search

Could I be configuring something wrong? But what? And why do the routes actually work when I click on them?
PS: I'm using Surface. Not sure if that makes a difference.

@Intelliractive
Copy link

Hello! Unfortunately, the project stopped working after I updated it.

before upgrade

defp deps do
    [
      #scrivener - pagination
      {:scrivener_ecto, "~> 2.0"},
      #waffle
      # {:waffle, "~> 1.1"},
      # {:waffle_ecto, "~> 0.0"},

      {:pbkdf2_elixir, "~> 2.0"},
      {:phoenix, "~> 1.6.16"},
      {:phoenix_ecto, "~> 4.4"},
      {:ecto_sql, "~> 3.6"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 3.0"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_view, "~> 0.17.5"},
      {:floki, ">= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~> 0.6"},
      {:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
      {:swoosh, "~> 1.3"},
      {:telemetry_metrics, "~> 0.6"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.18"},
      {:jason, "~> 1.2"},
      {:plug_cowboy, "~> 2.5"}
    ]
  end

after upgrade

defp deps do
    [
      #scrivener - pagination
      {:scrivener_ecto, "~> 2.7"},
      #waffle
      # {:waffle, "~> 1.1"},
      # {:waffle_ecto, "~> 0.0"},

      {:pbkdf2_elixir, "~> 2.0"},

      # {:phoenix, "~> 1.7.6"},
      {:phoenix, "~> 1.7.6", override: true},
      {:phoenix_ecto, "~> 4.4"},
      {:phoenix_html, "~> 3.0"},
      #новое: поддержка views
      {:phoenix_view, "~> 2.0"},
      {:phoenix_live_reload, "~> 1.4", only: :dev},
      {:phoenix_live_view, "~> 0.19.2"},
      {:phoenix_live_dashboard, "~> 0.8.0"},

      {:ecto_sql, "~> 3.10"},
      # {:postgrex, ">= 0.0.0"},
      {:postgrex, "~> 0.17.1"},
      # {:floki, ">= 0.30.0", only: :test},
      {:floki, "~> 0.34.3", only: :test},
      # {:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
      {:esbuild, "~> 0.7.0", runtime: Mix.env() == :dev},
      {:swoosh, "~> 1.11.1"},
      {:telemetry_metrics, "~> 0.6.1"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.22.2"},
      {:jason, "~> 1.4.0"},
      {:plug_cowboy, "~> 2.6.1"}
    ]
  end

Compiling 42 files (.ex)
warning: variable "_f" does not exist and is being expanded to "_f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_confirmation/edit.html.heex:3: Intelliractive23Web.UserConfirmationView."edit.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:3: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:10: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:11: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:1: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:1: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:8: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:10: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:12: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:9: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:3: Intelliractive23Web.UserConfirmationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:11: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:14: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:10: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:4: Intelliractive23Web.UserConfirmationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:16: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:15: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:5: Intelliractive23Web.UserConfirmationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:12: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:1: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:1: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:18: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/user_registration/new.html.heex:16: Intelliractive23Web.UserRegistrationView."new.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:13: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:8: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:23: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:8: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:14: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:9: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:24: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:9: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:16: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:5

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:10: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:29: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:10: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:17: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:4

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:12: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:30: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:12: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:18: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: undefined function form/1 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:3

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:16

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:36: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:13: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:13: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_confirmation/new.html.heex:3

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:20: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:15

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:37: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:14: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:14: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function form/1 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_confirmation/edit.html.heex:3

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:21: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:14

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:42: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:16: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:16: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:12

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:22: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:43: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:17: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:11

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:17: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:24: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:48: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:18: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function f/0 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:10

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:18: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:25: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:49: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:20: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: undefined function form/1 (expected Intelliractive23Web.UserRegistrationView to define such a function or for it to be imported, but none are available)
  lib/intelliractive23_web/templates/user_registration/new.html.heex:3

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:20: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:26: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:54: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:21: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:21: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: passing a string as a layout template in use options is deprecated, please pass {Intelliractive23Web.LayoutView, :live} instead of {Intelliractive23Web.LayoutView, "live.html"}
  (phoenix_live_view 0.19.2) lib/phoenix_live_view/utils.ex:207: Phoenix.LiveView.Utils.normalize_layout/2
  (phoenix_live_view 0.19.2) lib/phoenix_live_view.ex:497: Phoenix.LiveView."MACRO-__before_compile__"/2
  (elixir 1.14.3) src/elixir_dispatch.erl:224: :elixir_dispatch.expand_macro_fun/7
  (elixir 1.14.3) src/elixir_dispatch.erl:211: :elixir_dispatch.expand_require/6
  (elixir 1.14.3) src/elixir_dispatch.erl:135: :elixir_dispatch.dispatch_require/7
  (elixir 1.14.3) src/elixir_module.erl:412: :elixir_module.expand_callback/6

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:22: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:28: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:55: Intelliractive23Web.VideoView."form.html"/1


== Compilation error in file lib/intelliractive23_web/views/user_confirmation_view.ex ==
** (CompileError) lib/intelliractive23_web/templates/user_confirmation/edit.html.heex:3: undefined function _f/0 (expected Intelliractive23Web.UserConfirmationView to define such a function or for it to be imported, but none are available)

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:22: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:29: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:24: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:60: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:24: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:30: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:25: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/video/form.html.heex:61: Intelliractive23Web.VideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:25: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:26: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:32: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:26: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:28: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:33: Intelliractive23Web.VhMegaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_elite_video/form.html.heex:28: Intelliractive23Web.Vh_elite_videoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_giga_video/form.html.heex:29: Intelliractive23Web.VhGigaVideoView."form.html"/1

warning: variable "f" does not exist and is being expanded to "f()", please use parentheses to remove the ambiguity or change the variable name
  lib/intelliractive23_web/templates/vh_mega_video/form.html.heex:34: Intelliractive23Web.VhMegaVideoView."form.html"/1

@gerritwalther
Copy link

@Intelliractive you probably are using the deprecated version of let instead of :let. The former was removed with LiveView 0.19.0.

So instead of <.form let={f} for={@changeset}> ... you have to use <.form :let={f} for={@changeset}>

@kbernou
Copy link

kbernou commented Oct 26, 2023

@gerritwalther thank you, I had the exact same problem and that was the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment