问题
I just changed an image path in a template in my Phoenix app and reloaded the page. This error message appeared in the browser:
CompilationError at GET /
Showing console output
== Compilation error on file web/views/page_view.ex ==
** (CompileError) web/views/page_view.ex:1: cannot define module Youli.PageView because it is currently being defined in web/views/page_view.ex:1
(stdlib) erl_eval.erl:657: :erl_eval.do_apply/6
Running mix compile
in the terminal made the problem go away, but isn't there some way to skip that step?
回答1:
It is a bug in Elixir that has been fixed in Elixir v1.0.3.
来源:https://stackoverflow.com/questions/28912614/in-elixir-phoenix-after-template-change-cannot-define-module-myapp-pageview-b