nallwhy

nallwhy

Full Project Recompilation on Elixir 1.19 — How Can I Investigate the Root Cause?

Hi everyone,

I’m currently running into a strange full recompilation issue on Elixir 1.19 and I’d like some advice on how to further investigate the root cause.

Environment

  • Erlang/OTP 28.2

  • Elixir 1.19.4 (and all other 1.19.x versions show the same behavior)

  • Phoenix + Phoenix LiveView

  • Ash Framework

  • phoenix_live_reload enabled

Issue

Whenever any pattern exists under the phoenix_live_reload configuration, the following happens:

  1. Start the server with mix phx.server.

  2. Visit the web page.

  3. As soon as the request hits the server, the entire project recompiles.

After that, the server works normally.

But if I stop it and run mix phx.server again, the same full recompilation occurs on the next request.

This cycle repeats every time.

If I remove all patterns from live_reload, the issue disappears — but of course that disables LiveReload entirely.

What I’ve found so far

We’ve tracked the trigger point to the following part of the Phoenix code reloader:

https://github.com/phoenixframework/phoenix/blob/07fc5ac215b61849ba54c4cc506dbb1b5248d6d3/lib/phoenix/code_reloader/server.ex#L411

Something within this flow is causing the compiler to think all modules are stale, but we haven’t been able to determine why this happens specifically on Elixir 1.19.

Questions

I’d appreciate any advice on how to further approach this problem:

  • How can I inspect what Mix thinks has changed?

    (module timestamps, manifests, dependency graph diffs, etc.)

  • Is there a good way to trace which module is being marked as stale first?

  • Any recommended debugging flags or instrumentation for Mix or the Phoenix code reloader?

If anyone has encountered similar behavior in Elixir 1.19 — or knows how to dig deeper into the compiler’s staleness detection — I’d really appreciate your insights.

Thanks in advance!

First 2 of 2 Posts Switch mode

vanderhoop

vanderhoop

I’ve also been running into full recompilations on 1.19 in my phoenix app, and I’ve been suspecting that there were different elixir versions on my system (I’m using mise for language version management), but I’ve made sure that the global mise elixir and erlang versions align with my project’s version, but it still happens, but when I least want/expect it. My next suspicion is that it has something to do with running LSPs during development, in my case elixir-ls and refactorex, both via VSCode, but I haven’t been able to consistently reproduce the issue, so that’s just a suspicion at this point.

jechol

jechol

If you’re using Kino, this may be related.

I just merged a fix for a related issue here — it was merged very recently:
https://github.com/elixir-lang/elixir/pull/15007

— All posts loaded —

Where Next?

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement