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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews