How do you get the elixir compiler to show warnings when running a phoenix server?
Asked Answered
C

2

8

Running a phoenix server in iex session via mix, like:

iex -S mix phx.server

Will sometimes give a list of warnings like:

Compiling 1 file (.ex)
warning: variable "user" is unused
  lib/app_web/controllers/user_controller.ex:37

But seemingly only the first time the server is run, after which I suppose its cached and so it doesn't show up. How can I at a later time see these warnings to fix them? Thanks.

Croon answered 17/9, 2018 at 3:56 Comment(1)
Just a note: if you change something on a configuration file (config/*.exs), it is necessary to run again the server again (iex -S mix phx.server or mix phx.server) and compile everything again, so it will show you the warnings again.Boddie
M
20

Run mix compile --force to see all warnings again.

Moseley answered 17/9, 2018 at 6:41 Comment(0)
P
0

A simple method, use mix clean before iex -S mix phx.server, which will clean cache and show up warnings again.

Pretender answered 17/9, 2018 at 6:2 Comment(1)
I recommend to everyone interested in mix clean to read its documentation before to use it: "deletes all build artifacts for the current project".Boddie

© 2022 - 2024 — McMap. All rights reserved.