Elixir Dialyzer / Dialyxir PLT build failed in CI
Dialyzer needs a persistent lookup table (PLT) built from your deps and OTP. In CI it fails or times out when the PLT is missing and rebuilt every run, or reports type warnings that fail the gate.
What this error means
mix dialyzer errors with "Could not find ... PLT" / rebuilds the PLT on every run (slow), or exits non-zero on type warnings like "Function has no local return".
Could not find the project PLT at _build/dev/dialyxir_erlang-27.0_elixir-1.17.2.plt
Finding suitable PLTs ... none found, building from scratchCommon causes
PLT not cached, rebuilt every run
The PLT lives under _build. Without caching it (keyed on OTP/Elixir), each CI run rebuilds it from scratch, which is slow and can time out.
Real type warnings failing the gate
Dialyzer found a type discrepancy (an impossible pattern, a bad spec, no local return) and exits non-zero.
How to fix it
Cache the PLT keyed on the toolchain
- Cache the PLT directory keyed on OTP/Elixir and mix.lock.
- Build the PLT once, then reuse it across runs.
- Run
mix dialyzerafter the PLT is restored.
- uses: actions/cache@v4
with:
path: priv/plts
key: plt-${{ runner.os }}-otp${{ steps.beam.outputs.otp-version }}-elixir${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
- run: mix dialyzer --plt
- run: mix dialyzerFix the reported type discrepancy
Correct the @spec or the code path Dialyzer flags rather than ignoring the warning.
mix dialyzer --format shortHow to prevent it
- Cache the PLT keyed on OTP, Elixir, and mix.lock.
- Store PLTs in a fixed path via dialyzer: [plt_local_path: ...].
- Treat Dialyzer warnings as real type issues to fix.