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

First 8 of 8 Posts Switch mode

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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement