Should app.config.js return a promise?

Hi all! I am testing out the new app.config.js support @bacon added which allows us to have more dynamic and programmatic control over our configs and I have a suggestion.

Take the following case into consideration. I am adding some extra params that define an API_HOST containing a variety of URLs to hosts that are specific to release channels or environments I want to use.

For ‘development’ I want my API host to resolve to my machine’s hostname so I can run the API locally and have my device resolve directly to my machine. However, I cannot use exec from child_process because of the non-async nature of the app.config.js

const util = require('util');
const exec = util.promisify(require('child_process').exec);

module.exports = async function ({ projectRoot, config, mode }) {
  const hostname = await exec('hostname');

  config.extra = {
    API_HOST: {
      development: `http://${hostname}:3000`,
      staging: '',
      production: '',

  return config;

This code :top: is what I would like to do but is not allowed. Error from expo-cli is

Config file /Users/brandon/Dev/JS/goplaysave-mobile-v2/app.config.js cannot return a Promise.

Any chance I may be able to use async/await in future iterations of the app.config.js? I think this would make app.config.js even more powerful.

Maybe my entire approach is off? All suggestions are appreciated!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.