Yarn build fails in deployment - [@roots/bud-preset-wordpress] › ✖ TypeError [ERR_INVALID_URL]: Invalid URL

the thing is that there must be an environment variable set in this context. if it didn’t exist it wouldn’t error.

if (!this.app.env.has('WP_HOME') || !this.app.env.isString('WP_HOME'))
      return

we know that it exists and is a string.

  1. you could just add the .env to your bud project directory:
# /app/themes/sage/.env
WP_HOME=http://example.com
  1. you could use cross-env or equivalent