Help Finding Mysterious "no case clause matching" Error

I have a project that compiles with no errors. I’ve gone through the tests manually, and they all work when tested one by one. But when I try “mix test”, I get this error:

** (CaseClauseError) no case clause matching: {:error, :tokens}
    (kernel) file.erl:1369: :file.consult_stream/3
    (kernel) file.erl:978: :file.consult/1
    (mix) lib/mix/compilers/elixir.ex:347: Mix.Compilers.Elixir.parse_manifest/2
    (mix) lib/mix/compilers/elixir.ex:37: Mix.Compilers.Elixir.compile/5
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
    (mix) lib/mix/tasks/compile.all.ex:19: anonymous fn/1 in Mix.Tasks.Compile.All.run/1

I’ve commented out all tests, trying to isolate the error.

I’ve tried deleted every single test in the module & tests directory. Still getting the error?

Anyone know what would cause such an error?

What versions of Erlang and Elixir are you using? I suspect you may have something outdated. Try installing the most recent versions and removing the _build directory with rm -rf _build, and then install deps from scratch and run the tests.

Thanks. It worked.

1 Like

I did hesitate to post it initially since it was a wild guess, but glad I did help :wink:

1 Like