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) 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.
mix deps.get
MIX_ENV=prod mix deps.get
MIX_ENV=prod mix compileCache deps and key on the lockfile
- uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-${{ hashFiles('mix.lock') }}
- run: mix deps.getHow to prevent it
- Always run
mix deps.getbefore compile/test in CI. - Cache
depsand_buildkeyed onmix.lock. - Commit
mix.lockso the resolved set is reproducible.