Running mix clean generally fixes it for some compiler runs.
It is hard to show modules because the bug is very intermittent. It shows as CompileError in a specific Ecto.Schema module, but if I save the module it shows in a different module.
For example, I got this error message:
(CompileError) cannot define module AppWeb.AdminCompanyView because it is currently being defined in lib/app_web/views/admin_company_view.ex:1
Stacktrace:
│ (stdlib 3.15) erl_eval.erl:685: :erl_eval.do_apply/6
And this was a first, it never showed up on this module.
And this error came from the file lib/app_web/views/admin_company_view.ex itself, which may be that the compiler is compiling the file twice? Not an expert on the whole compilation pipeline.