yapi 本地运行项目 client 端报错

14ifxucb  于 2022-10-27  发布在  其他
关注(0)|答案(1)|浏览(493)

版本号

yapi v1.8.5 master 分支
node v7.6.0
npm v4.1.2
mongodb v4.2.1

什么问题

git clone 下来以后无法正常启动项目, client 端报错

✖ [12:05:46] 10 errors in compiling process.
[error] in ./client/Application.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./client/index.js 21:19-43

[error] in ./common/mock-extra.js

/home/work/yapi/vendors/common/mock-extra.js
  5:46  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./common/utils.js

/home/work/yapi/vendors/common/utils.js
  110:34  error  Unnecessary escape character: \}  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-advanced-mock/AdvMock.js

/home/work/yapi/vendors/exts/yapi-plugin-advanced-mock/AdvMock.js
  46:3  error  componentWillMount is deprecated since React 16.9.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] in ./exts/yapi-plugin-import-swagger/run.js

/home/work/yapi/vendors/exts/yapi-plugin-import-swagger/run.js
  144:18  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-statistics/statisticsClientPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-statistics/client.js 3:13-52

[error] in ./exts/yapi-plugin-gen-services/Services/Services.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-gen-services/client.js 3:16-49

[error] in ./exts/yapi-plugin-swagger-auto-sync/swaggerAutoSync/swaggerAutoSync.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-swagger-auto-sync/client.js 3:23-70

[error] in ./exts/yapi-plugin-wiki/wikiPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-wiki/client.js 3:13-40

[error] in ./exts/yapi-plugin-advanced-mock/MockCol/MockCol.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-advanced-mock/AdvMock.js 73:15-46

✔ [12:05:46] 200 GET /prd/index@dev.css ( 433.23KB )
✔ [12:05:46] 200 GET /prd/manifest@dev.js ( 23.71KB )
✔ [12:05:46] 200 GET /prd/lib3@dev.js ( 9158.00KB )
✔ [12:05:46] 200 GET /prd/lib2@dev.js ( 1979.50KB )
✔ [12:05:46] 200 GET /prd/lib@dev.js ( 1085.22KB )
✔ [12:05:46] 200 GET /prd/index@dev.js ( 7929.14KB )
✖ [12:05:53] 10 errors in compiling process.
[error] in ./client/Application.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./client/index.js 21:19-43

[error] in ./common/utils.js

/home/work/yapi/vendors/common/utils.js
  110:34  error  Unnecessary escape character: \}  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-advanced-mock/AdvMock.js

/home/work/yapi/vendors/exts/yapi-plugin-advanced-mock/AdvMock.js
  46:3  error  componentWillMount is deprecated since React 16.9.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] in ./exts/yapi-plugin-import-swagger/run.js

/home/work/yapi/vendors/exts/yapi-plugin-import-swagger/run.js
  144:18  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-statistics/statisticsClientPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-statistics/client.js 3:13-52

[error] in ./exts/yapi-plugin-gen-services/Services/Services.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-gen-services/client.js 3:16-49

[error] in ./exts/yapi-plugin-wiki/wikiPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-wiki/client.js 3:13-40

[error] in ./exts/yapi-plugin-swagger-auto-sync/swaggerAutoSync/swaggerAutoSync.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-swagger-auto-sync/client.js 3:23-70

[error] in ./exts/yapi-plugin-advanced-mock/MockCol/MockCol.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-advanced-mock/AdvMock.js 73:15-46

[error] in ./common/mock-extra.js

/home/work/yapi/vendors/common/mock-extra.js
  5:46  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

如何复现此问题

参照 https://hellosean1025.github.io/yapi/documents/redev.html 二次开发,启动 yarn dev 项目

什么浏览器

不是在浏览器中报错

什么系统(Linux, Windows, macOS)

Manjaro Linux x86_64

w8biq8rn

w8biq8rn1#

版本号

yapi v1.8.5 master 分支
node v7.6.0
npm v4.1.2
mongodb v4.2.1

什么问题

git clone 下来以后无法正常启动项目, client 端报错

✖ [12:05:46] 10 errors in compiling process.
[error] in ./client/Application.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./client/index.js 21:19-43

[error] in ./common/mock-extra.js

/home/work/yapi/vendors/common/mock-extra.js
  5:46  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./common/utils.js

/home/work/yapi/vendors/common/utils.js
  110:34  error  Unnecessary escape character: \}  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-advanced-mock/AdvMock.js

/home/work/yapi/vendors/exts/yapi-plugin-advanced-mock/AdvMock.js
  46:3  error  componentWillMount is deprecated since React 16.9.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] in ./exts/yapi-plugin-import-swagger/run.js

/home/work/yapi/vendors/exts/yapi-plugin-import-swagger/run.js
  144:18  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-statistics/statisticsClientPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-statistics/client.js 3:13-52

[error] in ./exts/yapi-plugin-gen-services/Services/Services.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-gen-services/client.js 3:16-49

[error] in ./exts/yapi-plugin-swagger-auto-sync/swaggerAutoSync/swaggerAutoSync.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-swagger-auto-sync/client.js 3:23-70

[error] in ./exts/yapi-plugin-wiki/wikiPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-wiki/client.js 3:13-40

[error] in ./exts/yapi-plugin-advanced-mock/MockCol/MockCol.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-advanced-mock/AdvMock.js 73:15-46

✔ [12:05:46] 200 GET /prd/index@dev.css ( 433.23KB )
✔ [12:05:46] 200 GET /prd/manifest@dev.js ( 23.71KB )
✔ [12:05:46] 200 GET /prd/lib3@dev.js ( 9158.00KB )
✔ [12:05:46] 200 GET /prd/lib2@dev.js ( 1979.50KB )
✔ [12:05:46] 200 GET /prd/lib@dev.js ( 1085.22KB )
✔ [12:05:46] 200 GET /prd/index@dev.js ( 7929.14KB )
✖ [12:05:53] 10 errors in compiling process.
[error] in ./client/Application.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./client/index.js 21:19-43

[error] in ./common/utils.js

/home/work/yapi/vendors/common/utils.js
  110:34  error  Unnecessary escape character: \}  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-advanced-mock/AdvMock.js

/home/work/yapi/vendors/exts/yapi-plugin-advanced-mock/AdvMock.js
  46:3  error  componentWillMount is deprecated since React 16.9.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] in ./exts/yapi-plugin-import-swagger/run.js

/home/work/yapi/vendors/exts/yapi-plugin-import-swagger/run.js
  144:18  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

[error] in ./exts/yapi-plugin-statistics/statisticsClientPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-statistics/client.js 3:13-52

[error] in ./exts/yapi-plugin-gen-services/Services/Services.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-gen-services/client.js 3:16-49

[error] in ./exts/yapi-plugin-wiki/wikiPage/index.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-wiki/client.js 3:13-40

[error] in ./exts/yapi-plugin-swagger-auto-sync/swaggerAutoSync/swaggerAutoSync.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-swagger-auto-sync/client.js 3:23-70

[error] in ./exts/yapi-plugin-advanced-mock/MockCol/MockCol.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (native)
    at Array.forEach (native)
 @ ./exts/yapi-plugin-advanced-mock/AdvMock.js 73:15-46

[error] in ./common/mock-extra.js

/home/work/yapi/vendors/common/mock-extra.js
  5:46  error  Unnecessary escape character: \.  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

如何复现此问题

参照 https://hellosean1025.github.io/yapi/documents/redev.html 二次开发,启动 yarn dev 项目

什么浏览器

不是在浏览器中报错

什么系统(Linux, Windows, macOS)

Manjaro Linux x86_64

同样遇到该问题,请教下您这边有没有解决?

相关问题