I've created an app and now want to deploy it, but I can't.
Steps I take to start the production server:
npm run build
npm run serve
It serves the app, but when I open it in the admin, this message appears:
"Your app is running without the SHOPIFY_API_KEY environment variable. Please ensure that it is set when running or building your React app."
I definitely have that environment variable in .env file in the web folder.
What can I do ?
Can you please elaborate on which server your App is hosted on?
And which Shopify template you are using?
Could you please clarify for me so that I can provide you with the solution?
Thanks. I later realized it was because dotenv wasn't configured properly, so the script couldn't read environment variables.
Yeah, so there needs to be two env files, one in web folder, one in frontend folder. And SHOPIFY_API_KEY variable needs to be in both of those files. But when deploying to a real server this probably won't be needed
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...By Arno Nov 27, 2023
You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...By Skye Nov 8, 2023