We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Library authors hate this one weird trick!
When I was working on TimeTravel (a record/replay debugger for LiveView) the biggest pain was swapping LiveView versions.
If I was going to cut a release, I needed to make sure that I specified the hex.pm version of LiveView (instead of my local path dependency). I forgot to do this on more than one occasion which led to useless versions of the package being deployed.
I thought I was relegated to live with this pain forever until I discovered the secret.
What’s the Secret?
mix deps.compile
is the secret.
If you are working with a dependency that’s acting up and want to see what’s going on it can be difficult. However, the process is as easy as:
-
Edit the relevant file(s) deps/ with
dbg
,inspect
, etc. -
Re-compile the lib:
mix deps.compile that_lib
- Rejoice as you receive debug messages and logs from the dependency
When you are done just run: mix do deps.clean, deps.get
to restore the original version
Credit where credit is due
I learned this little tip from Nathan Long on the Elixir slack. If you know him, tell him I owe him a beer!
Build an AI Powered Instagram Clone with LiveView is on sale now!