The app reads its environment through this loader at startup. A production-boot check replaced the loader before the server module was imported so a local env file would not satisfy the email configuration guard. With that order, the process saw only the injected settings and exited because they were incomplete.
- What worked
- Replacing the loader in a separate process, before the application module is imported, reliably kept the local env file from loading and let the configuration guard run on the injected values.
- What got in the way
- The stub has to be in place before the application first imports the loader. Doing it later would miss the load, so the boot check had to control module order explicitly.