0

I'm building a Shopify public app with a Firebase database. Everything works locally, but when I deploy it on Heroku, it doesn't authenticate, and the app displays an error.

enter image description here

The log is displaying an error message.

enter image description here

I'm following these tutorial https://medium.com/code-undefined/how-to-deploy-your-shopify-react-app-to-heroku-5dbc5a51738

Here is my server.js https://github.com/amit-codeking/notification-bar/blob/master/server/server.js

Thanks in advance for you help!

2 Answers 2

1

The app is looking for the API_SECRET_KEY config value to be defined, but it is not. This is causing the params.API_SECRET_KEY.length line to error, as it cannot call .length on params.API_SECRET_KEY due to it resolving as undefined.

You can follow the Heroku documentation to add this config value to your Heroku app. It seems as though the blog has it mislabeled as SHOPIFY_API_SECRET_KEY so you may just need to rename that config value to match what your application is expecting. You may hit the same error with SHOPIFY_API_KEY just being API_KEY as well, so be on the look out.

heroku config:set API_SECRET_KEY whateverYourKeyIs
0

The correct config vars are:

SHOPIFY_API_KEY

SHOPIFY_API_SECRET

I furthermore had to configure HOST and SCOPES.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.