Although parts of the following describe behavior observed in Phoenix, this is not a Phoenix bug (I’ll explain why later). It appears to be an Elixir bug, so I’m posting this in the “Elixir” category.
The possible bug
Recently, I encountered the following warning while developing a Phoenix application:
warning: mtime (modified time) for "lib/demo_web/controllers/page_html.ex" was set to the future, resetting to now
Have any of you encountered this issue? I haven’t seen any similar reports in the community.
To reproduce it:
- Create an app:
mix phx.new demo --no-ecto --no-live --no-tailwind - Enter the dev environment:
cd demo && iex -S mix phx.server - Visit http://localhost:4000 in your browser and keep the tab open (this is necessary, as it triggers the edge case)
- Modify
demo/lib/demo_web/controllers/page_html/home.html.heexand save - The warning should appear in your IEx. If not, repeat step 4 a few more times.
The chain of logic leading to the warning:
- We modify
demo/lib/demo_web/controllers/page_html/home.html.heex. Phoenix.LiveReloaderdetects the change and pushes an event to the browser.- The browser requests
/to refresh, triggeringPhoenix.CodeReloaderto reload the code. - The refreshed page requests
/phoenix/live_reload/socketto re-establish live reloading, triggeringPhoenix.CodeReloaderto reload the code again.
I suspect the warning is caused by two rapid successive calls to Phoenix.CodeReloader.reload/2, which in turn calls mix compile.elixir. To verify this, I created a minimal reproduction: GitHub - zekedou/elixir-compile-warning-1 · GitHub — and indeed, the warning reproduced.
I need help testing whether this is consistently reproducible across platforms and elixir versions. So far I’ve only tested on macOS — it would be great if those on Linux and Windows could test as well.
If this does turn out to be a bug, we’ll have already collected the necessary environment information.
How to help?
Run the project at GitHub - zekedou/elixir-compile-warning-1 · GitHub and report your results in the following format:
Reproduced?: Y/N
OS: <like macOS 15.7.5>
Erlang and Elixir:
<output of `elixir --version`>






















