beno

beno

Documenting the use of :included_applications

I have been struggling with trying to get an application deployed to a staging/production server today. I say struggle, because it still doesn’t work and as smooth as the developer experience is in Elixir, so bumpy is the road to deployment.

In this young environment I can understand how the tools aren’t quite there yet or in heavy flux with all kinds of versioning and compatibility conflicts. I can deal with those. But one thing I encountered was genuinely baffling, and that is that the code you develop appears to be not the same as the code you deploy, especially regarding dependencies. Things that compile and run without problems in development fail to run in production, mainly because of mix configuration and dependency issues.

One thing that cost me a sizeable part of my day was the use of non-application external libraries. After juggling lots of deps in my (umbrella) application, it compiles without issue and gets released to staging. Only at runtime the application fails because it misses those modules. I found out that adding them to :included_applications is needed to make this work. This seems like such a basic thing I was surprised that the documentation makes no mention of this. This leads me to believe I am missing something maybe? Finally, the production app I have now built and deployed is not behaving the same as the application I built in development, but I haven’t quite figured out what causes this.

In summary, if I am right about those external libraries and :included_applications , I think we should have this in the docs front and center. If I’m wrong, can someone please set me straight? Stepping back a bit, I think the development and production code should behave more similarly. Things that compile/run in development should also compile/run in release. In my experience, right now they don’t.

Sorry for the rant, everyone, thank you for your time.

Most Liked

josevalim

josevalim

Creator of Elixir

Yes, this should be filled as bug in the Rackla application. They should
not list a callback module if they don’t implement those callbacks.

Regarding the errors, yes, they only happen at runtime and in production
because the applications list is a list of runtime applications needed in
production. Although some tools warn of they see you are missing some
dependencies.

josevalim

josevalim

Creator of Elixir

@beno it won’t fetch a dependency when the current project is used as a dependency or when you are running it only in production (see mix deps.get --only prod for example).

Where Next?

Popular in Discussions Top

PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
WildYorkies
It seems that the more I read, the more I find Elixir users speaking about all the ways that Elixir is not good for x, y, and z use cases...
New
jeramyRR
This is an interesting article to read. Elixir’s performance, like usual, is excellent. However, it seems like the high CPU usage is co...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
100phlecs
Are there any downsides, like perf issues, to putting all functional components in CoreComponents as long as you prefix it with the conte...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement