Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors like "Phoenix.HTML.Engine.init/1 is undefined or private" and "Plug.Conn.__struct__/1 is undefined" after upgrading Elixir

I upgraded to Elixir 1.3. When I tried to start my Phoenix app with mix phoenix.server I got the error:

== Compilation error on file web/views/page_view.ex ==
** (UndefinedFunctionError) function Phoenix.HTML.Engine.init/1 is undefined or private

Attempting to fix it by upgrading libs, I got other errors like:

** (CompileError) lib/poison/parser.ex:11: Poison.SyntaxError.__struct__/1 is undefined, cannot expand struct Poison.SyntaxError

and

== Compilation error on file lib/plug/test.ex ==
** (CompileError) lib/plug/test.ex:53: Plug.Conn.__struct__/1 is undefined, cannot expand struct Plug.Conn
    (stdlib) lists.erl:1353: :lists.mapfoldl/3

Any ideas?

like image 348
Henrik N Avatar asked Jun 21 '16 15:06

Henrik N


1 Answers

What seemed to fix it for me was forcing dependencies to recompile:

mix deps.compile --force

If you get the error when attempting to run tests, try:

MIX_ENV=test mix deps.compile --force
like image 193
Henrik N Avatar answered Nov 04 '22 21:11

Henrik N