Elixir module is not loaded and could not be found on windows

after upgrading my windows 10 machine i get the following:

elixir module is not loaded and could not be found

If you’re upgraded windows I would strongly consider uninstalling and then reinstalling Elixir / Erlang.

An upgrade shouldn’t require a reinstall but it’s probably the easiest fix. You might have lost the path to Elixir in your Path environment variable.

thank you all, my fix was to uninstall/re-install. the new version 1.14 with phx 1.6. now it builds the app, however, there are tons of errors on modules either not found or not compiled with erl 25…

anywho: thanks one and all… this is the best forum for it’s quick responses…

:slight_smile:

Delete deps and _build directories, then mix deps.get, then mix compile.

thanks for the command stream, once executed, all of the compile errors are gone. what is left is a bunch of coding errors on the generated HTML code:

Invalid call found at 5 locations:
  lib/refuge_web/templates/user/edit.html.heex:3: RefugeWeb.UserView."edit.html"/1
  lib/refuge_web/templates/user/index.html.heex:21: RefugeWeb.UserView."index.html"/1
  lib/refuge_web/templates/user/index.html.heex:22: RefugeWeb.UserView."index.html"/1
  lib/refuge_web/templates/user/index.html.heex:23: RefugeWeb.UserView."index.html"/1
  lib/refuge_web/templates/user/show.html.heex:22: RefugeWeb.UserView."show.html"/1

question, why do I have to delete those two folders… are they pre-compiled with something else?

Thanks again…

Two reasons:

  1. If you f.ex. compile your deps + project with Erlang 25 underneath but then have to downgrade to Erlang 24 you’ll get errors. Often the Elixir/Erlang compiler apparatus detects these things and simply recompiles everything affected but sadly not always.
  2. Some Erlang dependencies have pre-compilation phases where they put files inside themselves e.g. think deps/an_erlang_library/a_file_tagged_with_erlang_version like something_25.1.2.hash. Then the library expects these files to be there after rebuilding; they are like cache on the disk but now your cache key is wrong. If you change what they rely on – namely the Elixir/Erlang version – they’ll fail because they “remember” that they were compiled with Erlang 25.1.2 but now you are using 25.2 so boom, error.

Since we can’t influence all library authors and how they do stuff then it’s best to, again, just delete deps and _build and then pull dependencies again and then do full rebuild. It’s the safest bet.

Mind you, this is not the norm and doesn’t happen as often as your experience or my feedback would have you believe. But I found that I am wasting the least amount of time if I just do it blindly every time I change Elixir or Erlang versions.

Another tidbit: if you remove a dependency from your project, always run mix deps.clean --unlock --unused after.

As for Phoenix errors, I stopped following it as I am not interested in any frontend work – even if it’s server-rendered pages – so I can’t help you there. Hopefully somebody else chimes in.

thanks for the great info… I’m doing a code assessment for a job interview and one of the tasks is to build an app to create a web report so I don’t have any choice but to build the entire app… but it’s a good experience… they gave me three hour but it’s taken me more than 8 hours just to reconfigure my environment and then there is the PostgreSql… wow…

thanks again for sharing your knowledge…

Sorry that you have been given such a merciless deadline for a homework assignment. Consider coming clean and telling the potential employer that you’re having difficulties.

If that’s not okay for them then they likely are not a good place to work.

I hear you, but it’s been a great experience…

I was able to successfully create the app and submit it with two rendering pages…

definitely got a log of good experience out of it…