heroku - 反应应用程序的circleci和heroku问题
问题描述
我的 CI/CD 是:git > cicleci > heroku
我正在使用circleci的建议配置(附在下面)
我在circleci中有正确的环境变量。
第一部分运行良好,但是,当我部署到 heroku 时,我可以看到来自开发人员依赖项的警告,例如:
./src/hooks/myHook.js
Line 11: React Hook useEffect has a missing dependency: 'x'. Either include it or remove the dependency array react-hooks/exhaustive-deps
这让我觉得 React dev 正在运行。
谁能帮我?
version: 2
jobs:
build:
...
deploy:
docker:
- image: buildpack-deps:trusty
steps:
- checkout
- run:
name: Deploy Master to Heroku
command: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
解决方案
我不确定您是否已经使用了,但我强烈建议您使用这个 Heroku buildpack 而不是标准的 Heroku Node buildpack:https ://github.com/mars/create-react-app-buildpack 。默认情况下,此 buildpack 在生产中启动。
在 Heroku 中,转到 settings > Buildpacks 并单击 Add buildpack,然后输入以下 url:https://github.com/mars/create-react-app-buildpack.git
并保存。
但是,如果出现上述挂钩错误,我会通过将其添加到挂钩中的依赖数组中来解决该问题。
推荐阅读
- php - 为什么我不能使用 img 标签回显?
- php - 将高级自定义字段添加到 Dokan 上的现有表单 - 添加产品和编辑产品页面 (WordPress/WooCommerce)
- laravel - Vuejs如何在子组件中使用Vue-slick?
- windows - 未定义的引用。在 cmake 中:lib 到 lib
- c# - Moq 设置给出错误 System.NullReferenceException
- c# - 如何在 wpf 中更改用户控件形式的另一个用户控件上的按钮?
- ruby - Ruby 块/匿名函数占位符参数
- sql-server - 您如何使用代理运算符而不是电子邮件地址使用 TSQL 发送电子邮件?
- javascript - 在节点 js 的 lof 文件中记录打印时显示当前日期和时间
- python - 将工资从一维数组转换为二维数组