When running an Elixir app, whenever there are errors in compilation, it shows at some random place (usually closer to the top) of the logs, so I have to scroll all the way up and sift through the logs to figure out what the error is.
I’ve tried removing Elixir and Erlang and re-installing them on my system to hopefully reset that behaviour but it’s still happening, I’m currently running Elixir 1.15.4
Here’s a screenshot of a simulated error:
Any help would be appreciated
Thanks!
I’ve noticed recently that if copy/paste an .ex file and then edit the module name the compiler gets confused and I get this module not found error about the original module.
Usually solved by deleting the app folder in _build/.
I’ve seen this as well since elixir 1.15. Not sure what is going on, but its definitely changed in some way.
1 Like
removing the _build/ folder works for me, thanks!
Just your app subfolder should be enough, it avoids recompiling all the dependencies.
03juan
July 22, 2023, 10:06am
6
Sounds like you could file an issue for this in the Elixir repo .
Or perhaps it has already been fixed on main and we’re awaiting a new release?
opened 05:45AM - 17 Jul 23 UTC
closed 04:02PM - 17 Jul 23 UTC
### Elixir and Erlang/OTP versions
Erlang/OTP 26 [erts-14.0.2] [source] [64-b… it] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]
Elixir 1.15.3 (compiled with Erlang/OTP 26)
### Operating system
Arch
### Current behavior
In an umbrella project, after removing the _build directory, when I initially run `mix test apps/some_app/some_test.exs`, it performs the first compilation as expected. However, upon subsequent runs, it triggers another compilation, although smaller. This behavior persists for several runs until it eventually stops compiling, which is the expected behavior since nothing has changed. In my case, this occurs around the fourth run, the compilation output also changes on every run.
I couldn't create a project that exactly reproduces this recompilation issue, however, after some investigation, I suspect this bug was introduced in f3c4c8c. Reverting this commit fixes the problem, it appears that the new `removed` variable is not empty when it should be (I think?).
To reproduce the behavior above, create an umbrella project with two apps. When running a test with IO.inspect on the `removed` variable, it produces the following output:

### Expected behavior
Mix test should not compile again if no file has changed.
You could try to build from source and see if the issue goes away.
If you’re using asdf
:
$ asdf install elixir ref:main
$ asdf local elixir ref:main <-- in your project directory
This sounds like it might be this change in Elixir 1.15:
The Elixir compiler can now emit many errors for a single file, making sure more feedback is reported to developers before compilation is aborted.