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 ]: component z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o is not registered #186

Open
li-yechao opened this issue Dec 13, 2023 · 1 comment
Assignees

Comments

@li-yechao
Copy link
Contributor

🐛 Bug Report

详细描述

其它组件在启动过程中调用 upload 接口报错,原因是启动过程中可能还没有讲当前组件注册到 components 中,导致 image-bin 中验证 x-component-did 时找不到组件后报错,这里也有可能是 server 导致的 @linchen1987

复现这个 bug

  1. 创建一个新的 blocklet
  2. 安装 image-bin 组件
  3. 启动 pages-kit 到这个 blocklet 中
  4. 启动过程中报错
(2023-12-13 23:54:45): call http://127.0.0.1:8099/api/sdk/uploads api failed {
(2023-12-13 23:54:45):   url: 'http://127.0.0.1:8099/api/sdk/uploads',
(2023-12-13 23:54:45):   responseStatus: 400,
(2023-12-13 23:54:45):   responseData: {
(2023-12-13 23:54:45):     error: 'component z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o is not registered'
(2023-12-13 23:54:45):   },
(2023-12-13 23:54:45):   error: {
(2023-12-13 23:54:45):     message: 'Request failed with status code 400',
(2023-12-13 23:54:45):     name: 'AxiosError',
(2023-12-13 23:54:45):     code: 'ERR_BAD_REQUEST',
(2023-12-13 23:54:45):     config: {
(2023-12-13 23:54:45):       transitional: [Object],
(2023-12-13 23:54:45):       adapter: [Function: httpAdapter],
(2023-12-13 23:54:45):       transformRequest: [Array],
(2023-12-13 23:54:45):       transformResponse: [Array],
(2023-12-13 23:54:45):       timeout: 60000,
(2023-12-13 23:54:45):       xsrfCookieName: 'XSRF-TOKEN',
(2023-12-13 23:54:45):       xsrfHeaderName: 'X-XSRF-TOKEN',
(2023-12-13 23:54:45):       maxContentLength: -1,
(2023-12-13 23:54:45):       maxBodyLength: -1,
(2023-12-13 23:54:45):       env: [Object],
(2023-12-13 23:54:45):       validateStatus: [Function: validateStatus],
(2023-12-13 23:54:45):       headers: [Object],
(2023-12-13 23:54:45):       url: 'http://127.0.0.1:8099/api/sdk/uploads',
(2023-12-13 23:54:45):       method: 'post',
(2023-12-13 23:54:45):       data: '{"type":"path","filename":"1675317651519-9sO6KvSfWJg4XYSJYxxVRuCg.jpeg","data":"/Users/chao/Projects/blocklet/pages-kit/api/template/pages/1675317651519-9sO6KvSfWJg4XYSJYxxVRuCg.jpeg"}'
(2023-12-13 23:54:45):     },
(2023-12-13 23:54:45):     request: ClientRequest {
(2023-12-13 23:54:45):       _events: [Object: null prototype],
(2023-12-13 23:54:45):       _eventsCount: 7,

截图或报错信息(可选)

异常的行为

期望的行为

可能的解决方案(可选)

@FireTable
Copy link
Collaborator

如果本地环境的话,nate 昨晚也遇到同样的问题
我排查了一下用的就是 config.components 筛选的
@linchen1987 感觉是不是 sdk 的问题?

image

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