Questions and discussions about using the Shopify CLI and Shopify-built libraries.
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.
Solved! Go to the solution
This is an accepted solution.
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.
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.
This is an accepted solution.
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.
@MarcoDo wrote: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.
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 😑😐)?
Experiencing the same issue. When I try to push it says everything is up to date... How should I debug it?
check .gitignore
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