Test compiler suddenly not finding MyApp.Factory helper file

Much of my testing is done with factories. This has been working, but as of today no test will compile. The error message says module MyApp.Factory is not loaded and could not be found.

My mix.exs file includes the following:


def project do
    [
      ...
      elixirc_paths: elixirc_paths(Mix.env()),
      ...
    ]
  end

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

Inside the test/support folder is the file, factory.ex, which includes “MyApp.Factory” at the top.

I’m stumped as to what changed… nothing of substance that I am aware of. Does anyone have any advice?
Thank you :slight_smile:

Hey @SArthur the first sanity check would be to rm _build deps and then re-refetch deps and recompile. Give that a go and report back if you’ve still got an issue.

2 Likes

That did the trick. Can’t thank you enough for the direction!

For the record, I also tried deps.clean and re-fetching as a less invasive first pass and that did not solve the problem. Thanks again :slight_smile:

1 Like