Owens

Owens

LiveView leex file throwing error even when empty

Hello all,

I’m getting this error in LiveView, even when the referenced html.leex file in the error is empty!

There was a call to RocketshipWeb.Router.Helpers.chat_show_path/3 but then I changed it to RocketshipWeb.Router.Helpers.chat_show_path/4 and the error message stayed. Then I deleted everything in the html.leex file and still the same error message.

Thanks for any help.

[error] #PID<0.609.0> running RocketshipWeb.Endpoint (connection #PID<0.579.0>, stream id 6) terminated
Server: localhost:4000 (http)
Request: GET /programs/62/chats/14
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function RocketshipWeb.Router.Helpers.chat_show_path/3 is undefined or private
        (rocketship 0.1.0) RocketshipWeb.Router.Helpers.chat_show_path(#Phoenix.LiveView.Socket<assigns: #Phoenix.LiveView.Socket.AssignsNotInSocket<>, changed: %{chat: true, page_title: true}, endpoint: RocketshipWeb.Endpoint, id: "phx-Fke9HKBk7TDsPwLh", parent_pid: nil, root_pid: nil, router: RocketshipWeb.Router, view: RocketshipWeb.ChatLive.Show, ...>, :edit, %Rocketship.Chats.Chat{__meta__: #Ecto.Schema.Metadata<:loaded, "chats">, chats_users: #Ecto.Association.NotLoaded<association :chats_users is not loaded>, cohort: #Ecto.Association.NotLoaded<association :cohort is not loaded>, cohort_id: 2, id: 14, inserted_at: ~N[2020-11-14 15:00:00], is_pinned: false, last_message: nil, name: "Encubay Cohort 1", organization: #Ecto.Association.NotLoaded<association :organization is not loaded>, organization_id: 2, parent_organization: #Ecto.Association.NotLoaded<association :parent_organization is not loaded>, parent_organization_id: 1, team: #Ecto.Association.NotLoaded<association :team is not loaded>, team_id: nil, type: "Cohort", updated_at: ~N[2020-11-14 15:00:00], users: #Ecto.Association.NotLoaded<association :users is not loaded>})
        (rocketship 0.1.0) lib/rocketship_web/live/chat_live/show.html.leex:36: anonymous fn/2 in RocketshipWeb.ChatLive.Show.render/1
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/diff.ex:303: Phoenix.LiveView.Diff.traverse/6
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/diff.ex:377: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/6
        (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/diff.ex:303: Phoenix.LiveView.Diff.traverse/6
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/diff.ex:111: Phoenix.LiveView.Diff.render/3
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/static.ex:284: Phoenix.LiveView.Static.to_rendered_content_tag/4
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/static.ex:144: Phoenix.LiveView.Static.render/3
        (phoenix_live_view 0.14.8) lib/phoenix_live_view/controller.ex:35: Phoenix.LiveView.Controller.live_render/3
        (phoenix 1.5.6) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2
        (rocketship 0.1.0) lib/rocketship_web/endpoint.ex:1: RocketshipWeb.Endpoint.plug_builder_call/2
        (rocketship 0.1.0) lib/plug/debugger.ex:132: RocketshipWeb.Endpoint."call (overridable 3)"/2
        (rocketship 0.1.0) lib/rocketship_web/endpoint.ex:1: RocketshipWeb.Endpoint.call/2
        (phoenix 1.5.6) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy 2.8.0) /Users/Owens/Code/Elixir/rocketship/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
        (cowboy 2.8.0) /Users/Owens/Code/Elixir/rocketship/deps/cowboy/src/cowboy_stream_h.erl:300: :cowboy_stream_h.execute/3
        (cowboy 2.8.0) /Users/Owens/Code/Elixir/rocketship/deps/cowboy/src/cowboy_stream_h.erl:291: :cowboy_stream_h.request_process/3
        (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

UPDATE: The issue was I renamed the html.leex to html.slimleex to use the slime engine before deleting the contents. Somehow it appears the contents from the html.leex template was stuck in memory? Because when I renamed it back to html.leex with no contents the problem went away (the page loaded without error and was empty). But now I can’t get anything to save when the file type is html.slimleex, even though I have another file in the directory with html.slimleex that updates fine…

Any help or thoughts here greatly appreciated.

Marked As Solved

Owens

Owens

Strangely. Closing Chrome and everything, as well as restarting my computer fixed this.

Also Liked

axelson

axelson

Scenic Core Team

If I recall correctly I’ve fixed a similar error in the past by restarting the phoenix server (or maybe I had to run mix clean also).

LostKobrakai

LostKobrakai

Template changes are tracked with the ˋ@external_resourceˋ module attribute, which uses paths to reference the external file.

Owens

Owens

Restarting the phoenix server didn’t fix it for me. Only going back to the leex extension instead of slimleex or staying with the slimleex extension and completely restarting my computer and Chrome browser.

Where Next?

Popular in Questions Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
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
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
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 t...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54250 245
New
New

We're in Beta

About us Mission Statement