Sir Kriden
Sir Kriden

Reputation: 11

Elixir phoenix web application broke after pushing to heroku

While trying to push my elixir phoenix web application to heroku I had quite a few issues which took pretty long to solve, but after I finally did... my application won't start anymore!

I'm still really new to elixir and phoenix and even heroku, so this is really a mystery for me.

When running mix phoenix.server this is my output:

** (UndefinedFunctionError) function Phoenix.Template.hash/2 is undefined or private. Did you mean one of:

  * hash/1

(phoenix) Phoenix.Template.hash("web/templates/error", "*")
web/views/error_view.ex:1: Dashboard.ErrorView.__phoenix_recompile__?/0
(elixir) lib/stream.ex:429: anonymous fn/4 in Stream.filter/2
(elixir) lib/enum.ex:3161: Enumerable.List.reduce/3
(elixir) lib/stream.ex:1433: Enumerable.Stream.do_each/4
(elixir) lib/enum.ex:1823: Enum.reverse/1
(elixir) lib/enum.ex:2581: Enum.to_list/1
(phoenix) lib/mix/tasks/compile.phoenix.ex:13: Mix.Tasks.Compile.Phoenix.run/1
(mix) lib/mix/task.ex:301: Mix.Task.run_task/3
(elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
(mix) lib/mix/tasks/compile.all.ex:19: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
(mix) lib/mix/tasks/compile.all.ex:37: Mix.Tasks.Compile.All.with_logger_app/1
(mix) lib/mix/task.ex:301: Mix.Task.run_task/3
(mix) lib/mix/tasks/compile.ex:85: Mix.Tasks.Compile.run/1
(mix) lib/mix/task.ex:301: Mix.Task.run_task/3
(mix) lib/mix/tasks/app.start.ex:50: Mix.Tasks.App.Start.run/1
(mix) lib/mix/task.ex:301: Mix.Task.run_task/3
(mix) lib/mix/tasks/run.ex:86: Mix.Tasks.Run.run/5
(mix) lib/mix/tasks/run.ex:54: Mix.Tasks.Run.run/1

Now, I don't really understand where this problem has come from and it seems very confusing to me and I would love some help.

I don't even know which files to share so you can maybe get some more information, but I'm willing to post any code in my project.

Upvotes: 1

Views: 1114

Answers (2)

Meeh
Meeh

Reputation: 2646

I had the same issue locally, and if you're working on multiple branches (which have multiple phoenix releases) ensure to rebuild dependencies, that might just be the issue.

Upvotes: 2

czinkipuczczum karamba
czinkipuczczum karamba

Reputation: 326

I had exactly the same problem. In my case it was due to bad elixir and erlang version. I solved it by installing erlang 18.2 and elixir 1.2.3

I suggest using version managers for erlang and elixir (I used kerl and envex)

Upvotes: 0

Related Questions