begedin

begedin

"No function clause matching in Plug.Conn.resp/3" when upgrading to 1.7

This is something that took a while for me to debug, so I’m posting it in the hopes that it speeds up someone else’s work. I’ve been getting this error with the arguments listed for the function being

  1. %Conn{}
  2. valid status number
  3. %Phoenix.LiveView.Rendered{}

The problem is, it looks like the logic to infer the rendered format has shifted slightly. I’ve been using this non-started approach to organize my templates in a flat structure, where I had

  • new.password.html for signing up with a username and password
  • new.email.html for signing up with just an email

Prior to 1.7, the format was correctly inferred as html. Now, however, it’s being inferred as password.html.

So my solution to get tests to pass was to replace

render(conn, "new.password.html", assigns)

with

render(conn, :"new.password", assigns)

in my controllers respectively.

Long term, I will of course fully migrate, but for now, the error was kind of cryptic and the only way to fully figure it out was to generate a new 1.7 app, based on that, add formats: [:html] to my use Phoenix.Controller in my_app_web.ex and then the error message became less cryptic, saying “password.html” is an invalid format.

Most Liked

kuzyn

kuzyn

Oldie but goodie. Thanks @begedin, had the same cryptic bug during my own migration path. It was also caused by using a template name with an extra dot in it, to delineate the language of the page:

info.fr.html.eex
info.en.html.eex

For my case, I simply renamed the template and moved on.

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement