Skip to content
Latchkey

Elixir "Unchecked dependencies" in CI

Mix found dependencies declared in mix.exs that are not present in deps/. They were never fetched, or the lockfile changed without a re-fetch, so Mix refuses to continue.

What this error means

A mix compile, mix test, or release task fails immediately with "Unchecked dependencies for environment <env>", listing the deps and telling you to run mix deps.get. Nothing compiles because the deps are missing.

mix output
** (Mix) Unchecked dependencies for environment prod:
  * jason (Hex package)
    the dependency is not available, run "mix deps.get"

Common causes

Dependencies not fetched in this environment

A CI step ran mix compile without first running mix deps.get for that MIX_ENV, so deps/ is empty for it.

Lockfile changed without a re-fetch

A mix.lock update (new or bumped dep) was committed but mix deps.get was not re-run, so deps/ is stale relative to the lock.

How to fix it

Fetch deps for the right environment

Run mix deps.get (and set MIX_ENV) before compiling or testing.

Terminal
mix deps.get
MIX_ENV=prod mix deps.get
MIX_ENV=prod mix compile

Cache deps and key on the lockfile

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: |
      deps
      _build
    key: mix-${{ hashFiles('mix.lock') }}
- run: mix deps.get

How to prevent it

  • Always run mix deps.get before compile/test in CI.
  • Cache deps and _build keyed on mix.lock.
  • Commit mix.lock so the resolved set is reproducible.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →