ycherniavskyi
I’m working on two Phoenix projects: A and B. Project B provides an HTTP API that is utilized by project A. Additionally, project B implements a Util module that project A uses. This is accomplished by adding project B as a dependency from GitHub to project A.
During development, I added the following dependency to project A:
defp deps do
[
# ...
{:a, app: false, github: "c/a", branch: "main"}
]
end
I used app: false to prevent loading and running the application from project B, allowing project A to only use the Util module from project B.
However, when I create a release of project A with MIX_ENV="prod" mix release, I encounter an error when executing ./_build/prod/rel/a/bin/a start:
(CompileError) _build/prod/rel/a/releases/0.1.0/runtime.exs:100: module RuntimeConfig is not loaded and could not be found
Upon inspecting the _build/prod/rel/a/lib directory, I noticed that the b dependency is missing.
What is the correct way to add project B as a dependency to project A for this specific use case? I would appreciate any advice or suggestions.
Trending in Questions
Other Trending 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
- #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 2- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
jchrist
I think an included application does what you describe. Roughly, in project
A’smix.exs, you want to setruntime: falsefor the dependency toB, then update your application config:The release will then include
:bbut not automatically start it. Note that if you have:bas a dependency elsewhere, that may cause it to start regardless - you need to addruntime: falsethere as well, in that case.Hope that helps
ycherniavskyi
That worked brilliantly!
I updated
depsas follows:and
applicationby:In my case, I didn’t need to add anything to
extra_applicationsbecause I was only using one simple module fromB, which didn’t require any additional applications.