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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
roeland
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
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews