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

🧐[问题] properties of null (reading 'useContext') #194

Open
hello-yajing opened this issue May 8, 2024 · 6 comments
Open

🧐[问题] properties of null (reading 'useContext') #194

hello-yajing opened this issue May 8, 2024 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@hello-yajing
Copy link

🧐 问题描述

自定义Actions中的按钮引入antd的Button/图标,会报错:
image

💻 示例代码

`

{ return [
, ...defaultDoms, ]; }, flexConfig: { gap: 24, direction: 'horizontal', justify: 'space-between', }, }} request={async (messages) => { const mockedData: string = `这是一段模拟的流式字符串数据。本次会话传入了${messages.length}条消息`;
      const mockResponse = new MockResponse(mockedData);

      return mockResponse.getResponse();
    }}
  />
</div>

`

🚑 其他信息

版本信息:
`
{
"private": true,
"author": "yj ********@qq.com",
"scripts": {
"dev": "umi dev",
"build": "umi build",
"postinstall": "umi setup",
"setup": "umi setup",
"start": "npm run dev"
},
"dependencies": {
"@ant-design/pro-chat": "^1.12.2",
"antd": "^5.16.1",
"antd-style": "^3.6.2",
"umi": "^4.1.9"
},
"devDependencies": {
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"typescript": "^5.0.3"
}
}

`

@hello-yajing
Copy link
Author

image
代码重新发一下

@ONLY-yours
Copy link
Collaborator

感觉错误不在这里,我这边一切良好。

antd/icons 需要你手动安装下,我看你的 packagejson 并没有指定,可以试试指定下

@ONLY-yours ONLY-yours added the help wanted Extra attention is needed label May 8, 2024
@hello-yajing
Copy link
Author

感觉错误不在这里,我这边一切良好。

antd/icons 需要你手动安装下,我看你的 packagejson 并没有指定,可以试试指定下

手动安装了,还是报错;换成了“lucide-react”能解决问题

@hello-yajing
Copy link
Author

image

@ONLY-yours
Copy link
Collaborator

有点奇怪,我这个issue先放着,如果我这边能复现到问题,我在这里继续推进。

@hello-yajing
Copy link
Author

有点奇怪,我这个issue先放着,如果我这边能复现到问题,我在这里继续推进。

好嘞,非常感谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants