How to update /app-center/v1/api/apps/schema/:id componentsMap ?
问题简单描述:
启动Node 服务端后,设计器界面正常渲染,但预览页面无法正常渲染 Element-plus 组件,因为缺少 componentsMap 定义。
问题复现步骤:
- 按照文档进行Node服务端的部署 官网文档
- 进行物料同步
pnpm splitMaterials
pnpm buildMaterials
pnpm buildMaterials 执行时出现的问题:
问题1:同步过程中发现提供过的初始化Sql 创建的 t_component 表结构与插入格式不匹配。
该问题已通过使用 java 项目中的表结构初始化解决问题。
问题2: Error: ER_NO_SUCH_TABLE: Table 'xxx.r_material_history_component' doesn't exist
查看发现未初始化该表结构。 https://github.com/opentiny/tiny-engine/blob/9ee36c1291f86fb32cbf38b25dc7edb234b3751d/scripts/connection.mjs#L224
同样按照 java 项目中的表结构初始化
问题3: 预览页面无法正常渲染 Element-plus 组件
定位接口: /app-center/v1/api/apps/schema/:id
排查后定位 componentsMap 缺少相关定义。
推测:是否与问题2中组件关联物料资产包没有成功执行有关?
我应该如何继续修复这个问题?
非常期待得到您的帮助,谢谢 💐💐
Bot detected the issue body's language is not English, translate it automatically.
Title: How to update /app-center/v1/api/apps/schema/:id componentsMap ?
A brief description of the problem:
After starting the Node server, the designer interface renders normally, but the preview page cannot render the Element-plus component because the componentsMap definition is missing.
Problem recurrence steps:
- Deploy the Node server according to the document Official website document
- Perform material synchronization
pnpm splitMaterials
pnpm buildMaterials
Problems occurring when pnpm buildMaterials is executed:
Question 1: During the synchronization process, it was found that the t_component table structure created by initialization Sql did not match the insertion format.
This issue has been solved by using table structure initialization in java projects.
Question 2: Error: ER_NO_SUCH_TABLE: Table 'xxx.r_material_history_component' doesn't exist
Viewing found that the table structure was not initialized. https://github.com/opentiny/tiny-engine/blob/9ee36c1291f86fb32cbf38b25dc7edb234b3751d/scripts/connection.mjs#L224
Also initialize according to the table structure in the java project
Issue 3: The preview page cannot render the Element-plus component normally
Positioning interface: /app-center/v1/api/apps/schema/:id
After troubleshooting, the location componentsMap is missing related definitions.
Speculation: Is it related to the failure of the component-associated material asset package in question 2 to execute successfully?
How should I continue to fix this?
Looking forward to your help, thank you 💐💐
https://github.com/opentiny/tiny-engine/pull/1474
需要确保物料中包含 destructuring: true 的相关字段,并且正确更新到物料中
{
"npm": {
"destructuring": true
}
}