Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] umi-max 集成 @umijs/max-plugin-openapi 插件报错如:Cannot read properties of undefined (reading 'version') #11998

Closed
zhaoming1995 opened this issue Dec 25, 2023 · 3 comments

Comments

@zhaoming1995
Copy link

What happens?

添加了umi-openapi插件,之后运行pnpm openapi,报错如下

D:\workbench\Admin-Sys\demo>pnpm openapi

demo@v1 openapi D:\workbench\Admin-Sys\demo
max openapi

Using openapi Plugin
D:\workbench\Admin-Sys\demo\node_modules.pnpm@umijs+openapi@1.9.4\node_modules@umijs\openapi\dist\serviceGenerator.js:231
this.version = info.version;
^

TypeError: Cannot read properties of undefined (reading 'version')
at new ServiceGenerator (D:\workbench\Admin-Sys\demo\node_modules.pnpm@umijs+openapi@1.9.4\node_modules@umijs\openapi\dist\serviceGenerator.js:231:29)
at D:\workbench\Admin-Sys\demo\node_modules.pnpm@umijs+openapi@1.9.4\node_modules@umijs\openapi\dist\index.js:71:30
at Generator.next ()
at fulfilled (D:\workbench\Admin-Sys\demo\node_modules.pnpm\tslib@2.6.2\node_modules\tslib\tslib.js:166:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.0
 ELIFECYCLE  Command failed with exit code 1.

求助如何解决?

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

package.json

"dependencies": {
"@ant-design/charts": "^2.0.3",
"@ant-design/icons": "^5.2.6",
"@ant-design/pro-components": "^2.6.43",
"@umijs/max": "^4.0.89",
"@umijs/max-plugin-openapi": "^2.0.3",
"antd": "^5.12.3",
"swagger-ui-dist": "^5.10.5"
},

Context

  • Umi Version:
  • 4.0.89
  • Node Version:
  • v18.17.0
  • Platform:
Copy link

由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2023
@zhaoming1995 zhaoming1995 changed the title [Bug] [Bug]umi-max 集成 @umijs/max-plugin-openapi 插件报错如:Cannot read properties of undefined (reading 'version') [Bug] umi-max 集成 @umijs/max-plugin-openapi 插件报错如:Cannot read properties of undefined (reading 'version') Dec 25, 2023
@fz6m
Copy link
Contributor

fz6m commented Dec 27, 2023

max openapi 的源码在这个 仓库 ,可以自己去看下源码位置是缺少了什么,貌似这个插件需要你的 package.json 中有 nameversion

@zyk2891
Copy link

zyk2891 commented Jan 12, 2024

我也遇到了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants