Compiler error, but everything is ok in my files

hi guys, another error now,

== Compilation error on file web/views/topic_view.ex ==
** (CompileError) web/views/topic_view.ex:1: cannot define module Discuss.Topic because it is currently being defined in web/models/topic.ex:1
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

i cleaned all the deps then i got it again but when i fire the server i got this error.

what can i do?

thanks.

1 Like

Well, is the error correct? It’s saying you define the same module twice. What is the module you define in web/views/topic_view.ex. What is the module you define in web/models/topic.ex ?

1 Like

i found it right now, this is madness…two hours to find the error! and was so simple…basically wasa typo, i define it like Discuss.Topic, instead of TopicView for the view.

thanks aw.

1 Like

Yup. Do you see how the error tells you this information?

1 Like

yeah now i saw that it say to look in the view file, because in the beginning i passed that line and i was checking only the model file, and everything was good there.

ahah

thanks.

1 Like