jdj_dk
Mix phx.server does not recompile on changes!
Hi all.
Quick question.
I have a phoenix app which does not recompile when I change any elixir code in dev mode. What could I have screwed up? ![]()
If I change something and type recompile in iex in returns :noop. I am however able to recompile single modules using r Module manually.
I’m running Phoenix 1.4 and Elixir 1.7 on macOS Mojave.
Thanks in advance
First Post!
NobbZ
- What editor are you using (there are known issues with vim and one of its plugins)
- Have you installed the dependencies to make filesystem watching work? I’m not sure if there is a fallback to FS polling when the necessary tools arent available.
Most Liked
l00ker
In my experience changes to the controllers usually recompile when the page is reloaded, but the controllers don’t recompile directly after code changes because they aren’t being watched for changes by live_reload, but if needed, you should be able to add them in config/dev.exs.
# config/dev.exs
...
# Watch static and templates for browser reloading.
config :my_app, MyApp.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
+ ~r{lib/my_app_web/controllers/.*(ex)$},
~r{lib/my_app_web/views/.*(ex)$},
~r{lib/my_app_web/templates/.*(eex)$}
]
]
...
I’m guessing they were excluded from the live_reload patterns for a reason. Too many errors that way maybe? ![]()
NobbZ
If other projects on the same computer work, then you probably have the system level dependencies.
Then I’d try the usual, simply remove deps and _build folder and try again.
OvermindDL1
Huh? I run through tmux excessively, nor do I see any way that tmux would cause such an issue, can you elaborate more? o.O?
Last Post!
dalerka
Looks like a similar issue was discussed here:
https://github.com/phoenixframework/phoenix/issues/3365#issuecomment-489035119
and the bug reported here - Redirecting…
So, when I tried to reproduce with the fsdebug.erl module suggested by @josevalim and the command:
for i in $(seq 1 20); do echo "koko" >> /tmp/koko; sleep 0.5; done
I get no events caught at all:
❯ erl
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V11.1 (abort with ^G)
1> c("fsdebug").
fsdebug.erl:2: Warning: export_all flag enabled - all functions will be exported
{ok,fsdebug}
2> fsdebug:start_link()
2>
2>
2>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
(l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
Appreciate any suggestions about possible workarounds!
p.s: My current system:
Linux ... 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









