pfun
Using 1.7.0-rc.0 for some experiments and it quickly became obvious that while code reloading is working as usual in lib/<appname>_web and elsewhere in the app, it is not working in lib/<appname>. This is a vanilla/out of the box application. I added phx.gen.auth to have some more code to edit that really should cause a reload.
I have tried this with a couple different versions of Elixir and Erlang. I tried going back to 1.6 and confirmed it’s working fine there. Finally, I used a different laptop (tested MacOS 12.4 and 12.6) and the same thing was observed.
Anyone else seen this? Third-party confirmation would be appreciated as well!
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
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
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
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
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
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
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
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
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
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
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
derpycoder
Try mix deps.compile file_system
It fixed the issue with live reload, for me, after I updated both Mac and Phoenix.
pfun
Unfortunately this had no effect. On the second machine I tried this on there was no elixir (or really any devtools at all) beforehand. Completely clean install of erlang/elixir/phoenix 1.7 rc0
Worth clarifying, also, that I’m not talking about ‘live reload’, but just basic code reloading like editing the generated
user.exfrom phx.gen.auth. Changing the code does not cause the server to reload this code so it just keeps running the old version (e.g. addrequire LoggerandLogger.error("TEST")touser.exwhile the server is running, and you will not see the log (or at least, I don’t).kokolegorille
You might check the live reload patterns in config/dev.exs ans adjust them…
This post might be helpful.
pfun
Thanks but again that is for live reload, when I’m talking about just basic code reloading. As in the Phoenix server knowing that you edited an elixir file and using the new version. Nothing at all to do with browser reloading
pfun
If anyone would like to try to reproduce:
Go to register a user and put in only 4 chars for password, say. You get a validation error as expected. Now go to
lib/testapp/accounts/user.exand add tovalidate_emailfunction or similar, something like:Hit submit button again in browser. I do not see my new log. Change text of log, hit button again – still no log. Restart the server and try again, log appears! Edit the log message again, hit button again, log text does not change.
babouinette
I can say I have the same problem
pfun
Well that’s… ‘good’?
Thanks for confirming!
beepbeepbopbop
Can you clarify whether or not you are using LiveView based authentication system? When you run
mix phx.gen.auth Accounts User users, you are given the prompt:I can only assume that you are using LiveView and if that’s the case, I think I know why your changes to your
user.exfile aren’t being reflected. If you checkendpoint.ex, you can see thatplug Phoenix.CodeReloaderis specified. So every request to your dev server goes through this plug and runsPhoenix.CodeReloader.reload(ExampleWeb.Endpoint)for you. If you were to make your logger change and reload the page, this ought to work and your change honoured.Now, this doesn’t work with LiveView since they are process based. Once your LiveView connection is mounted (as in your LV has successfully mounted in both calls), all changes will be pushed to the LV, and won’t go through the
Phoenix.CodeReloader. You would need to update something yourwebdirectory, or runrecompilein youriexsession.I am not absolutely sure that this is the case, but give it a go without LV and see if you can replicate the issue you have.
Rugged
Did you lodge a git issue, as I think this would be good to have fixed before final release.
I couldn’t see it here, but maybe its already closed.
pfun
Yea, this is an interesting point. It is a liveview auth system. However having worked with liveview before I’ve never had a code reloading problem like this. I’m going to try it with a non-live auth right now – uno momento.
Sadly an out-of-the-box non-liveview auth system seems to fail on the register page with
no "new" html template defined for TestappWeb.UserRegistrationHTML(similar for the login page).Anyway, simply the fact that you see stuff like:
when editing in
<appname>_weband not in<appname>seems like a problem to me.@Rugged yea I had considered doing that right off the bat, but also I tend to assume it’s me doing something wrong by default
were you able to confirm this behaviour yourself by any chance?