App reviews, troubleshooting, and recommendations
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
cd ./web
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 ?
Hello @seymur_crsp
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.
Can you tell me how you configured your dotenv properly? It's very helpful to me.
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
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025