Shopify CLI deploy Heroku -- page unresponsive

Solved
MarcoDo
Shopify Partner
18 4 8

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)

Screenshot 2021-03-21 at 16.02.50.png

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.
 
 
Accepted Solution (1)

Accepted Solutions
MarcoDo
Shopify Partner
18 4 8

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.

View solution in original post

Replies 9 (9)
MarcoDo
Shopify Partner
18 4 8

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)

Screenshot 2021-03-21 at 19.39.01.png

 

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?

policenauts
Shopify Partner
194 9 55

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. 

MarcoDo
Shopify Partner
18 4 8

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

policenauts
Shopify Partner
194 9 55

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. 

MarcoDo
Shopify Partner
18 4 8

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.

Droppx
New Member
5 0 0

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

brianecook
New Member
1 0 0

@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 😑😐)?

wellbranding
Tourist
10 0 1

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

Ihor-Sh
New Member
1 0 0

check .gitignore