Updating phoenix version 1.4.10 to 1.5.4

hi,

I’m working on a LiveView project but the project is using all the old versions of elixir and phoenix. So yesterday I updated all the deps and also LiveView updated.

{:phoenix_live_view, “~> 0.7.1”} to latest one

After this, I compiled all of them which is working right now. But the API’s which has written in the router is starting to break and one of the errors I’m getting is this

GET /sign_in
[debug] Processing with TuringWeb.SessionController.sign_in/2
  Parameters: %{}
  Pipelines: [:browser]
warning: Rendering the child template from layouts is deprecated. Instead of:

    <%= render(@view_module, @view_template, assigns) %>

You should do:

    <%= @inner_content %>

  (phoenix 1.5.4) lib/phoenix/view.ex:283: Phoenix.View.render/3
  (turing 0.1.0) lib/turing_web/templates/layout/app.html.eex:14: TuringWeb.LayoutView."app.html"/1
  (phoenix 1.5.4) lib/phoenix/view.ex:472: Phoenix.View.render_to_iodata/3
  (phoenix 1.5.4) lib/phoenix/controller.ex:776: Phoenix.Controller.render_and_send/4
  (turing 0.1.0) lib/turing_web/controllers/session_controller.ex:1: TuringWeb.SessionController.action/2
  (turing 0.1.0) lib/turing_web/controllers/session_controller.ex:1: TuringWeb.SessionController.phoenix_controller_pipeline/2
  (phoenix 1.5.4) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2
  (turing 0.1.0) lib/plug/error_handler.ex:65: TuringWeb.Router.call/2
  (turing 0.1.0) lib/turing_web/endpoint.ex:1: TuringWeb.Endpoint.plug_builder_call/2
  (turing 0.1.0) lib/plug/debugger.ex:132: TuringWeb.Endpoint."call (overridable 3)"/2
  (turing 0.1.0) lib/turing_web/endpoint.ex:1: TuringWeb.Endpoint.call/2
  (phoenix 1.5.4) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
  (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
  (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_stream_h.erl:300: :cowboy_stream_h.execute/3
  (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_stream_h.erl:291: :cowboy_stream_h.request_process/3
  (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

[info] Sent 200 in 47ms
[info] POST /sign_in
[debug] ** (Phoenix.Router.NoRouteError) no route found for POST /sign_in (TuringWeb.Router)
    (turing 0.1.0) lib/phoenix/router.ex:402: TuringWeb.Router."call (overridable 2)"/2
    (turing 0.1.0) lib/plug/error_handler.ex:65: TuringWeb.Router.call/2
    (turing 0.1.0) lib/turing_web/endpoint.ex:1: TuringWeb.Endpoint.plug_builder_call/2
    (turing 0.1.0) lib/plug/debugger.ex:132: TuringWeb.Endpoint."call (overridable 3)"/2
    (turing 0.1.0) lib/turing_web/endpoint.ex:1: TuringWeb.Endpoint.call/2
    (phoenix 1.5.4) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
    (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_stream_h.erl:300: :cowboy_stream_h.execute/3
    (cowboy 2.8.0) /Users/siddhant/Documents/turing/deps/cowboy/src/cowboy_stream_h.erl:291: :cowboy_stream_h.request_process/3
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

I’m carefully checking both phoenix version but I’m not able to locate the exact error. Can someone help me understand this?

Hi Siddhant!

In your app.html.leex file just replace the line:

<%= render(@view_module, @view_template, assigns) %>

with

<%= @inner_content %>

Yeah, I replaced that one but somehow it’s not able to find this API in the router. Also, there is no post API in the previous version of the router.ex file. There was just couple of GET request. I don’t know why it’s looking for a POST api here.

Maybe going through the relevant changes in this diff between Phoenix 1.4.10 and 1.5.4 will help?

I found this issue. Do you think it’s related to this?