YMFE / yapi

YApi 是一个可本地部署的、打通前后端及QA的、可视化的接口管理平台
http://yapi.smart-xwork.cn/
Apache License 2.0
27.19k stars 4.77k forks source link

maoOS 构建client报错 #1219

Open shifengdiy opened 4 years ago

shifengdiy commented 4 years ago

版本号

~ 1.7.1

什么问题

~ 运行npm run build-client构建报错,貌似可以构建出文件,但是会报错停止

如何复现此问题

~ ✖ 1 problem (1 error, 0 warnings) 报错信息

[error] ./client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js

/Users/shifeng/Documents/work/yapi/vendors/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js
  170:9  error  componentWillMount is deprecated since React 16.999.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components                       react/no-deprecated
  468:9  error  componentWillReceiveProps is deprecated since React 16.999.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 2 problems (2 errors, 0 warnings)

[error] ./client/components/ModalPostman/index.js

/Users/shifeng/Documents/work/yapi/vendors/client/components/ModalPostman/index.js
  64:3  error  componentWillMount is deprecated since React 16.999.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 1 problem (1 error, 0 warnings)

[error] ./client/containers/Project/Interface/InterfaceList/Run/AddColModal.js

/Users/shifeng/Documents/work/yapi/vendors/client/containers/Project/Interface/InterfaceList/Run/AddColModal.js
  44:3  error  componentWillMount is deprecated since React 16.999.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components                       react/no-deprecated
  49:3  error  componentWillReceiveProps is deprecated since React 16.999.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 2 problems (2 errors, 0 warnings)

[error] ./client/components/ModalPostman/VariablesSelect.js

/Users/shifeng/Documents/work/yapi/vendors/client/components/ModalPostman/VariablesSelect.js
  79:9  error  componentWillReceiveProps is deprecated since React 16.999.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 1 problem (1 error, 0 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yapi-vendor@1.7.1 build-client: `NODE_ENV=production ykit pack -m`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yapi-vendor@1.7.1 build-client 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!     /Users/shifeng/.npm/_logs/2019-07-17T08_10_50_615Z-debug.log

什么浏览器

~ Chrome浏览器

什么系统(Linux, Windows, macOS)

macOS 10.14

shifengdiy commented 4 years ago

已解决,是eslint错误导致程序退出,在eslintrc中加入 "react/no-deprecated": ["off"] 消除错误

cheny-github commented 4 years ago

舒服了