the app works fine in my local development environment.
However, when I try to deploy the app to a server and run
npm run build --api-key=MY_API_KEY
I encounter the following error:
"Building the frontend app without an API key. The frontend build will not run without an API key. Set the SHOPIFY_API_KEY environment variable when running the build command."
To resolve this issue, I tried running the build command with the environment variable set as follows:
SHOPIFY_API_KEY=MY_API_KEY npm run build
This successfully addressed the API key error.
However, now when I attempt to install my app on a development store, the installation flow redirects to the React page I built, but then redirects back to Shopify with a 404 error. It seems that the authentication, app installation, and recurring charge steps are being missed.