【问题标题】:Issue with circleci and heroku with react app反应应用程序的circleci和heroku问题
【发布时间】:2019-07-01 20:46:58
【问题描述】:

我的 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 circleci circleci-2.0


    【解决方案1】:

    我不确定您是否已经使用了,但我强烈建议您使用这个 Heroku buildpack 而不是标准的 Heroku Node buildpack:https://github.com/mars/create-react-app-buildpack。此 buildpack 默认在生产环境中启动。

    在 Heroku 中转到设置 > Buildpacks 并单击 Add buildpack,然后输入以下 url:https://github.com/mars/create-react-app-buildpack.git 并保存。

    但是,如果出现上述挂钩错误,我会通过将其添加到挂钩中的依赖数组中来解决该问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-20
      • 2021-10-30
      • 2016-07-05
      • 1970-01-01
      • 1970-01-01
      • 2022-10-01
      相关资源
      最近更新 更多