rakeshtripathy

rakeshtripathy

Need help for below errors


(UndefinedFunctionError) function Phoenix.View.render/3 is undefined (module Phoenix.View is not available)
Phoenix.View.render(MyWebApp.LayoutView, "_app_v3.html", %{})
(phoenix 1.7.2) lib/phoenix/controller.ex:1010: anonymous fn/5 in Phoenix.Controller.template_render_to_iodata/4
(telemetry 1.2.1) /app/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
(phoenix 1.7.2) lib/phoenix/controller.ex:976: Phoenix.Controller.render_and_send/4
(phoenix 1.7.2) lib/phoenix/endpoint/render_errors.ex:84: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
phoenix 1.7.2) lib/phoenix/endpoint/render_errors.ex:62: Phoenix.Endpoint.RenderErrors.__catch__/5

Showing Posts 1 to 8

josevalim

josevalim

Creator of Elixir

Add {:phoenix_view, "~> 2.0"} to your mix.exs. Is a required step when migrating to Phoenix v1.7.

rakeshtripathy

rakeshtripathy OP

I have added {:phoenix_view, “~> 2.0”} in mix.exs while migrating to Phoenix V1.5, but it gives issues while pushing the code, there is no issues in the local environment.

linusdm

linusdm

Please supply more details (error logs) about the issues you’re experiencing. There is nothing to guide anybody any further.

rakeshtripathy

rakeshtripathy OP

I am migrating Elixir version from 1.10 to 1.12, and Phoenix v1.4 to 1.5.
Also I have upgraded image version for the same.

The application is working fine in dev environment, but while pushing from dev to QA, I am getting above error.
After migrating I am getting errror

(UndefinedFunctionError) function Phoenix.View.render/3 is undefined (module Phoenix.View is not available)
Phoenix.View.render(MyWebApp.LayoutView, “_app_v3.html”, %{})
(phoenix 1.7.2) lib/phoenix/controller.ex:1010: anonymous fn/5 in Phoenix.Controller.template_render_to_iodata/4
(telemetry 1.2.1) /app/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
(phoenix 1.7.2) lib/phoenix/controller.ex:976: Phoenix.Controller.render_and_send/4
(phoenix 1.7.2) lib/phoenix/endpoint/render_errors.ex:84: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
phoenix 1.7.2) lib/phoenix/endpoint/render_errors.ex:62: Phoenix.Endpoint.RenderErrors.catch /5

Below is my config file

config :my_future_now, MyWebApp.Endpoint,
render_errors: [view: MyWebApp.ErrorView, accepts: ~w(html json pdf)]

In error_view.ex

def render(“500.html”, _assigns) do
render(“500_internal_server_error.html”, %{})
end

In 500_internal_server_error.html.pug page :

body
= render LayoutView, “_app_v3.html”

codeanpeace

codeanpeace

Hmm, as a sanity check – the stacktrace suggests that you are migrating to v1.7 and not v1.5, is that what you set out to do?

And since it’s working fine in your dev environment but not QA environment after adding the phoenix_view dependency, have you double checked that the CI/CD pipelines run mix deps.get for your QA environment?

rakeshtripathy

rakeshtripathy OP

Not sure why the version shows phoenix 1.7.2 in error, but I have migrated to Phoenix v1.5 not 1.7.

Yes, CI/CD pipelines runs mix deps.get and mix deps.compile.

I am unable to find the root cause of this issue.

josevalim

josevalim

Creator of Elixir

If the code says 1.7.2 in the stacktrace, then you are running 1.7.2. Try calling mix deps and confirming which version Phoenix is running on.

rakeshtripathy

rakeshtripathy OP

I have fixed this issue by removing layout: false from render_errors in config.ex

Thank you all for your support.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews