Exadra37
DISCLAIMER: I just play with Elixir and Phoenix occasionally.
In a default install of Phoenix we get this config:
config :tasks, TasksWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/tasks_web/{live,views}/.*(ex)$",
~r"lib/tasks_web/templates/.*(eex)$"
]
]
The problem with the above config is that each time I edit a code file outside templates, views or live I need to manually restart the server, and this is so annoying and prone to forget, thus leading to debugging an error that doesn’t exist, aka I just forgot to restart the server… or am I missing something?
But this config works like a charm to me:
config :tasks, TasksWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/tasks_web/.*(ex)$",
~r"lib/tasks/.*(ex)$",
]
]
So can I run in any weird situation because of using this type of live reload config?
Would not be better to have this live reload config by default?
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
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
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
The live reload config you see here is about which files should, immediately on save, automatically trigger the page itself to reload.
It’s the
code_reloaderthat handles recompiling your core Elixir code on page refresh. I ran a new copy of phoenix and saw the following inendpoint.ex:And when I checked
dev.exsI see:Importantly
code_reloader: true. Does this line up with what you see in your project?sb8244
One potential issue here is what happens if you have a GenServer that assumes state in a certain format, then you change it, it reloads the code, and the old genserver state is now erroneous.
This is just speculation on my part, but I’m assuming that this is why the default is the way it is. The files that Phoenix owns are known to be safe, but your application cannot be known to be safe. Beginners may get even more confused by not knowing why things are broken.
Exadra37
Code reloader is enabled:
Thanks for the explanation, but I see this issue across a lot of pet projects I play with, but I will try later in neu project and see if I can spot any difference.
Exadra37
No using one, at least directly, plus this issue with code not reloading is across several projects.
This is what I am trying to understand, If the defaults are just playing on the safe side as you say or it’s something wrong in my setup.
benwilson512
Is there anything unusual about your development environment? Are you running stuff inside docker?
Exadra37
Yes I am, and the container have inotify tools installed and the limit increased.
benwilson512
Which OS?
Exadra37
OS
Host:
Container:
Inotify
Host
Container
Seems this container is after all missing the increase in the inotify watchers… Seems that at some point in time I may have removed it accidentally from the base image.
I will fix this and see if it solves the issue.