alibaba / alibaba/lowcode-engine

单独接入antd 的 umd 物料后 报错,渲染失败, TypeError: Cannot read properties of null (reading 'useContext')

Open
#3,070 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

## **Describe the bug (required)** / **详细描述 bug(必填)**

A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述

image

TypeError: Cannot read properties of null (reading 'useContext')
---

## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**

Steps to reproduce the behavior: / 详细复现步骤:

---

中文版示例:
1: 单独使用 react-renderer, 采用 umd 引antd 的umd, 使用 antd 的组件时报错

```

const Components: Record = {
ImageView,
DivView,
AView,
Button: window.antd.Button,
Tag
}
```

## **Expected behavior (required)** / **预期行为(必填,非常重要)**
能正常渲染

---

## **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

Research direction

Start by reproducing the issue with react-renderer and the antd UMD bundle, using the shown Components mapping and window.antd.Button entry point. Collect the AliLowCodeEngine, AliLowCodeEngineExt, browser, materials, plugins, and tools versions, then verify that the antd component renders without the useContext error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.