Shopify CLI deploy Heroku -- page unresponsive

Topic summary

Issue: A Shopify CLI Node app deployed to Heroku renders inside Shopify Admin but is completely unresponsive. Opening the app URL directly shows “https:undefined…” errors, and the browser console reports “AppBridgeError: APP::ERROR::INVALID_CONFIG: apiKey must be provided,” suggesting environment variables aren’t being read.

What was configured: Heroku config vars set (SHOPIFY_API_KEY, SHOPIFY_SECRET_KEY, scopes, host, shop). App URL and whitelisted redirect URL updated to the Heroku domain.

Key finding/resolution: Several users report it starts working only after making an initial commit and running “git push heroku master” in addition to “shopify deploy heroku.” This indicates the deploy step alone didn’t propagate the code/config as expected.

Debugging tips shared:

  • Log process.env.SHOPIFY_API_KEY on Heroku to confirm it’s present.
  • If push says “up to date,” inspect .gitignore (files may not be committed/deployed).

Open questions/remaining issues: One user still affected suspects the HOST env var; no confirmed value was provided. Another asks why a manual “git push heroku master” is necessary and whether it’s documented. Status: partially resolved; cause and documentation remain unclear.

Summarized with AI on February 16. AI used: gpt-5.

Hey,

I created my app with Shopify CLI “shopify create” (Node.js app) and deployed it to Heroku (shopify deploy). I already add my .env variables (scopes ,SHOPIFY_API_KEY, SHOPIFY_SECRET_KEY, host, shop) to my heroku config Vars, and I changed my app url to https://MY-URL.herokuapp.com/ , and the whitelisted redirect urls to https://MY-URL.herokuapp.com/auth/callback

When trying to open the app in my dev store, the interface is shown correctly (see image below)

However, the interface is unresponsive. So e.g. I can not press the button or select the text with mouse. (actually I can not do any mouse actions at all)

I have no idea what could cause this unresponsiveness.

Further info:

If i open https://MY-URL.herokuapp.com/ in browser, Safari says "Safari cant find the server, “https:undefined/admin/oauth/authorize?..”,

Chrome says "

This site can’t be reached

Check if there is a typo in undefined.

DNS_PROBE_FINISHED_NXDOMAIN"

I deployed the app a few hours ago (~2 hours) .

Thank you in advance, any help is appreciated.

1 Like

I want to provide more information. I think I came closer to the root cause.

When opening the app from Shopify Admin (as in the screenshot above) I opened the console (see screenshot below)

As you can see, it says “{name: “AppBridgeError”, message: “APP::ERROR::INVALID_CONFIG: apiKey must be provided”, action: undefined, type: “APP::ERROR::INVALID_CONFIG”, stack: “AppBridgeError: APP::ERROR::INVALID_CONFIG: apiKey must be provided”}”

However, I included the SHOPIFY_API_KEY as key in my Heroku config vars (and the value without “” ). I have not changed the code generated by shopify-cli ( so I still try to access with process.env.SHOPIFY_API_KEY ).

Maybe I made a mistake when trying to include my config vars with Heroku?

My memory on this is really foggy as this was months ago, but I recall when I created a Rails app using shopify CLI and deployed to heroku, I needed to also make sure I manually added the environment variables in the Heroku interface.

Hey, thank you for your help, but as I already did add my env. variables to Heroku manually.

Sorry, I missed that. I’d do a console.log() then to confirm what Heroku thinks your api key is, because right now it looks like it’s coming up null.

I just figured out the solution.

Apparently, it is not enough to do “shopify deploy heroku” and setting your .env variables in Heroku.

I also had to make an initial commit and “git push heroku master” to get it working.

Hi,

I am experiencing the same issue and I have done “git push heroku master”. I don’t see any errors in the console.

I suspect my problem is the host env in heroku. What host did you put in heroku env?

Thank you for any help

I had the same issue and git push heroku master fixed it surprisingly. Anyone have any idea why this works? Does Shopify have this step documented anywhere (guessing not :expressionless_face: :neutral_face: )?

Experiencing the same issue. When I try to push it says everything is up to date… How should I debug it?

check .gitignore