I\'ve recently deployed a React/Express app to Heroku, but I\'m having an issue with environment variables that are part of the built app and the Heroku deployment pipeline
You cannot rebuild the slug, the main point of pipelines is to move the same slug between apps.
What you need to do is to fetch API_URL at runtime and not during build process. You can put all envs in one file, for example env.js
export const API_URL = process.env.API_URL;
export const OTHER_VAR = process.env.OTHER_VAR;
And then just import what you need in other files
import { API_URL, OTHER_VAR } from 'env.js';