alibaba / alibaba/lowcode-engine
Cannot read property 'symbol' of undefined
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## **Describe the bug (required)** / **详细描述 bug(必填)**
```
TypeError: Cannot read property 'symbol' of undefined
at getDocgenTypeHelper (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/@alilc+lowcode-material-parser@1.0.3/node_modules/@alilc/lowcode-material-parser/lib/parse/ts/index.js:204:14)
at getFunctionReturns (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/@alilc+lowcode-material-parser@1.0.3/node_modules/@alilc/lowcode-material-parser/lib/parse/ts/index.js:46:22)
at getDocgenTypeHelper (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/@alilc+lowcode-material-parser@1.0.3/node_modules/@alilc/lowcode-material-parser/lib/parse/ts/index.js:304:26)
at MyParser.getDocgenType (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/@alilc+lowcode-material-parser@1.0.3/node_modules/@alilc/lowcode-material-parser/lib/parse/ts/index.js:360:24)
at /Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/react-docgen-typescript@1.22.0_typescript@4.7.2/node_modules/react-docgen-typescript/lib/parser.js:429:25
at Array.forEach ()
at MyParser.Parser.getPropsInfo (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/react-docgen-typescript@1.22.0_typescript@4.7.2/node_modules/react-docgen-typescript/lib/parser.js:402:27)
at MyParser.Parser.getComponentInfo (/Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/react-docgen-typescript@1.22.0_typescript@4.7.2/node_modules/react-docgen-typescript/lib/parser.js:187:30)
at /Users/xxx/Code/low-code/low-code-engine/node_modules/.pnpm/@alilc+lowcode-material-parser@1.0.3/node_modules/@alilc/lowcode-material-parser/lib/parse/ts/index.js:474:27
at Array.reduce ()
```
https://github.com/alibaba/lowcode-engine/blob/fb580b5fb2653aec27e2213425e2865719002542/modules/material-parser/src/parse/ts/index.ts#L346-L348
checker.typeToTypeNode返回的类型是TypeNode.
https://github.com/alibaba/lowcode-engine/blob/fb580b5fb2653aec27e2213425e2865719002542/modules/material-parser/src/parse/ts/index.ts#L51-L59
55行, ~~TypeNode是没有type字段的~~(官方的类型里没找到type字段, 但部分case运行时有发现存在),所以会传入undefined,再接着运行就会出问题
A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述
---
## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**
Steps to reproduce the behavior: / 详细复现步骤:
---
```
import React from 'react';
import 'react-dom';
interface Props {
onKeyPress: JSX.IntrinsicElements['input']['onKeyPress'];
}
const Input = (p: Props) => {
return (
);
};
export { Input };
```
把这个当做组件库入口, 用@alifd/build-plugin-lowcode跑meta生成
## **Expected behavior (required)** / **预期行为(必填,非常重要)**
A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为
---
## **Screenshots (optional)** / **bug 截图(可选)**
Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题
---
## **Environments (please complete the following information) (required):** / **请提供如下信息(必填)**
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
> (this information can be collected via [the manual plugin](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png) / 版本信息可[通过低代码用户手册插件收集](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png))
## **Additional context (optional)** / **更多额外信息(可选)**
Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.