arpan

arpan

Hello everyone,

I am currently working on an Elixir project that utilizes an umbrella app setup. Unfortunately, we are encountering numerous compilation issues that are adversely affecting our development experience. I would greatly appreciate your assistance and guidance regarding these challenges.

To provide some context, our umbrella app consists of the following apps:

  • web: Live view user-facing app
  • admin: Live view internal admin app
  • api: GraphQL API app
  • db: DB schemas, changeset, contexts
  • pool: Background jobs, cron jobs, Broadway, etc.

Here is a visual representation of the dependency graph:

Now, let’s delve into the problems we are currently facing:

  1. Lazy Compilation:
    We have observed that when we make code changes, the code only partially compiles. We expected that running mix compile followed by starting the server would eliminate the need for further compilation. However, we are encountering situations where the code starts compiling again after the server is launched or upon hitting certain code paths, such as specific browser URLs.

  2. Mismatch in Compile-time vs. Runtime Value Configuration:
    During server startup, we often encounter errors indicating a mismatch between the compile-time and runtime values of certain configurations. For example:

    ERROR! the application :db has a different value set for key :default_admin_id during runtime compared to compile time. Since this application environment entry was marked as compile time, this difference can lead to different behaviour than expected:
    
    * Compile time value was set to: nil
    * Runtime value was set to: "xxxx"
    

    The environment variable is correctly sourced in the terminal and available during compilation. This error typically occurs when restarting the server process within the same terminal. The only workaround we have found is to kill the server process and execute mix compile --force.

  3. Nebulex:
    We are utilizing Nebulex for caching purposes, but we frequently encounter the following error:

    (Nebulex.RegistryLookupError) could not lookup Nebulex cache App.API.Cache.UserCache because it was not started or it does not exist
    

    This issue often arises when code changes trigger recompilation while the server is running or when manually recompiling in the iex session. The only solution we have found is to restart the server.

  4. Unfinished Compilation:
    When making code changes, we often encounter errors due to the code attempting to access modules that are still in the process of compilation. For instance, the web app may attempt to access a module in the db app that is still compiling, leading to errors. This becomes more problematic due to live reloading in Phoenix.
    We expect the app to wait until all related modules and umbrella dependencies have finished compiling before attempting to load a page. Additionally, we feel that there are unnecessary compilations of unrelated components even for minor code changes, resulting in slower development cycles.

I would greatly appreciate any help, suggestions, or insights regarding these issues.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
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
velrest
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
samoloth
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
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

bartblast
This is the follow-up to my ElixirConf EU talk in Malaga, which was mostly about the local-first problem and where sync engines stand on ...
New
JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
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
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews