[英]Error when deploying Shopify React App with Heroku
I am trying to create a Shopify public app with firebase database.我正在尝试使用 firebase 数据库创建一个 Shopify 公共应用程序。 All working with local but not authenticating with Heroku.所有都使用本地但不使用 Heroku 进行身份验证。 It's deploying fine but not loading the app (showing application error)部署正常但未加载应用程序(显示应用程序错误)
On log it will showing some error like在日志上它会显示一些错误,例如
I'm following these tutorial https://medium.com/code-undefined/how-to-deploy-your-shopify-react-app-to-heroku-5dbc5a51738我正在关注这些教程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这是我的 server.js https://github.com/amit-codeking/notification-bar/blob/master/server/server.js
Thanks in advance for you help!提前感谢您的帮助!
The app is looking for the API_SECRET_KEY
config value to be defined, but it is not.该应用程序正在寻找要定义的API_SECRET_KEY
配置值,但事实并非如此。 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
.这导致params.API_SECRET_KEY.length
行出错,因为它无法在params.API_SECRET_KEY
上调用.length
,因为它解析为undefined
。
You can follow the Heroku documentation to add this config value to your Heroku app.您可以按照Heroku 文档将此配置值添加到您的 Heroku 应用程序中。 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.似乎博客将其错误标记为SHOPIFY_API_SECRET_KEY
因此您可能只需要重命名该配置值以匹配您的应用程序所期望的值。 You may hit the same error with SHOPIFY_API_KEY
just being API_KEY
as well, so be on the look out.您可能会遇到同样的错误, SHOPIFY_API_KEY
也只是API_KEY
,所以请注意。
heroku config:set API_SECRET_KEY whateverYourKeyIs
The correct config vars are:正确的配置变量是:
SHOPIFY_API_KEY
SHOPIFY_API_SECRET
I furthermore had to configure HOST
and SCOPES
.我还必须配置HOST
和SCOPES
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.