Bitbucket 管道失败并且不允许我创建反应构建

Bitbucket pipeline is failing and not letting me create the react build

从今天早上开始,我在使用 Bitbucket Pipelines 构建 React 应用程序时遇到错误。我的应用程序之前没有任何变化,相同的构建工作正常,但从今天开始显示问题。

当我尝试在本地构建我的应用程序时,我没有收到任何错误。

Build setup
6s
CI=false
<1s
cd React/WebApp
<1s
npm install
1m 57s
CI=false npm run build
6m 20s
+ CI=false npm run build
> dev2@0.1.0 build /opt/atlassian/pipelines/agent/build/React/WebApp
> react-scripts build
Creating an optimized production build...
Failed to compile.
src/App.jsx
  Line 50:5:  Missing "key" prop for element in array  react/jsx-key
src/common/card_information/card_information.jsx
  Line 23:7:    Missing "key" prop for element in array  react/jsx-key
  Line 23:7:    Missing "key" prop for element in array  react/jsx-key
  Line 23:7:    Missing "key" prop for element in array  react/jsx-key
  Line 27:7:    Missing "key" prop for element in array  react/jsx-key
  Line 27:7:    Missing "key" prop for element in array  react/jsx-key
  Line 27:7:    Missing "key" prop for element in array  react/jsx-key
  Line 28:9:    Missing "key" prop for element in array  react/jsx-key
  Line 28:9:    Missing "key" prop for element in array  react/jsx-key
  Line 31:13:   Missing "key" prop for element in array  react/jsx-key
  Line 36:9:    Missing "key" prop for element in array  react/jsx-key
  Line 36:9:    Missing "key" prop for element in array  react/jsx-key
  Line 38:7:    Missing "key" prop for element in array  react/jsx-key
  Line 38:7:    Missing "key" prop for element in array  react/jsx-key
  Line 38:7:    Missing "key" prop for element in array  react/jsx-key
  Line 60:17:   Missing "key" prop for element in array  react/jsx-key
  Line 60:17:   Missing "key" prop for element in array  react/jsx-key
  Line 61:19:   Missing "key" prop for element in array  react/jsx-key
  Line 63:17:   Missing "key" prop for element in array  react/jsx-key
  Line 63:17:   Missing "key" prop for element in array  react/jsx-key
  Line 64:19:   Missing "key" prop for element in array  react/jsx-key
  Line 76:17:   Missing "key" prop for element in array  react/jsx-key
  Line 76:17:   Missing "key" prop for element in array  react/jsx-key
  Line 77:19:   Missing "key" prop for element in array  react/jsx-key
  Line 79:17:   Missing "key" prop for element in array  react/jsx-key
  Line 79:17:   Missing "key" prop for element in array  react/jsx-key
  Line 80:19:   Missing "key" prop for element in array  react/jsx-key
  Line 89:11:   Missing "key" prop for element in array  react/jsx-key
  Line 113:13:  Missing "key" prop for element in array  react/jsx-key
  Line 114:15:  Missing "key" prop for element in array  react/jsx-key
  Line 114:15:  Missing "key" prop for element in array  react/jsx-key
  Line 114:15:  Missing "key" prop for element in array  react/jsx-key
  Line 114:15:  Missing "key" prop for element in array  react/jsx-key
  Line 114:15:  Missing "key" prop for element in array  react/jsx-key
  Line 115:17:  Missing "key" prop for element in array  react/jsx-key
  Line 117:15:  Missing "key" prop for element in array  react/jsx-key
  Line 117:15:  Missing "key" prop for element in array  react/jsx-key
  Line 117:15:  Missing "key" prop for element in array  react/jsx-key
  Line 117:15:  Missing "key" prop for element in array  react/jsx-key
  Line 117:15:  Missing "key" prop for element in array  react/jsx-key
  Line 118:17:  Missing "key" prop for element in array  react/jsx-key
  Line 118:17:  Missing "key" prop for element in array  react/jsx-key
  Line 119:17:  Missing "key" prop for element in array  react/jsx-key
  Line 119:17:  Missing "key" prop for element in array  react/jsx-key
  Line 121:15:  Missing "key" prop for element in array  react/jsx-key
  Line 121:15:  Missing "key" prop for element in array  react/jsx-key
  Line 121:15:  Missing "key" prop for element in array  react/jsx-key
  Line 121:15:  Missing "key" prop for element in array  react/jsx-key
  Line 121:15:  Missing "key" prop for element in array  react/jsx-key
  Line 131:15:  Missing "key" prop for element in array  react/jsx-key
  Line 131:15:  Missing "key" prop for element in array  react/jsx-key
  Line 131:15:  Missing "key" prop for element in array  react/jsx-key
  Line 131:15:  Missing "key" prop for element in array  react/jsx-key
  Line 131:15:  Missing "key" prop for element in array  react/jsx-key
  Line 135:23:  Missing "key" prop for element in array  react/jsx-key
  Line 135:23:  Missing "key" prop for element in array  react/jsx-key
  Line 136:25:  Missing "key" prop for element in array  react/jsx-key
  Line 138:23:  Missing "key" prop for element in array  react/jsx-key
  Line 138:23:  Missing "key" prop for element in array  react/jsx-key
  Line 139:25:  Missing "key" prop for element in array  react/jsx-key
  Line 145:15:  Missing "key" prop for element in array  react/jsx-key
  Line 145:15:  Missing "key" prop for element in array  react/jsx-key
  Line 145:15:  Missing "key" prop for element in array  react/jsx-key
  Line 145:15:  Missing "key" prop for element in array  react/jsx-key
  Line 145:15:  Missing "key" prop for element in array  react/jsx-key
  Line 149:23:  Missing "key" prop for element in array  react/jsx-key
  Line 149:23:  Missing "key" prop for element in array  react/jsx-key
  Line 150:25:  Missing "key" prop for element in array  react/jsx-key
  Line 152:23:  Missing "key" prop for element in array  react/jsx-key
  Line 152:23:  Missing "key" prop for element in array  react/jsx-key
  Line 153:25:  Missing "key" prop for element in array  react/jsx-key
  Line 161:19:  Missing "key" prop for element in array  react/jsx-key
  Line 185:7:   Missing "key" prop for element in array  react/jsx-key
  Line 188:13:  Missing "key" prop for element in array  react/jsx-key
  Line 195:11:  Missing "key" prop for element in array  react/jsx-key
  Line 197:9:   Missing "key" prop for element in array  react/jsx-key
  Line 197:9:   Missing "key" prop for element in array  react/jsx-key
  Line 198:11:  Missing "key" prop for element in array  react/jsx-key
  Line 201:9:   Missing "key" prop for element in array  react/jsx-key
  Line 201:9:   Missing "key" prop for element in array  react/jsx-key
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dev2@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the dev2@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-25T13_22_41_074Z-debug.log
2022-02-25T13:22:41.098641374Z stdout P   Line 26:7:  

我可以在所有 jsx 上添加密钥,但昨天它使用相同的代码,但现在它告诉我在所有 jsx 上添加密钥道具,这是不可能的,因为应用程序有超过 100 个模块(我已经删除了错误行从错误中保持问题简短)。甚至不是它提到的所有 jsx 元素都是数组元素。

我找到了解决方案

 "react/jsx-key": 0,

将此添加到项目的 .eslintrc.json 管道将开始工作