begedin
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
%Conn{}- valid status number
%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.htmlfor signing up with a username and passwordnew.email.htmlfor 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.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 1- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
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:
For my case, I simply renamed the template and moved on.