Closed Cynwell closed 10 months ago
Bot detected the issue body's language is not English, translate it automatically.
Title: 🐛 [Bug]: There is a problem with the rendering of Element-plus third-party components in preview state
@Cynwell 查看下appinfo.json中materialHistory.components中有没有element的相关组件
只有 tiny-engine/mockServer/src/services
里面有 appInfo.json
。这个文件里面有 element-plus 组件的相关信息。
但我是通过 pnpm serve:frontend
启动 tiny-engine 的前端,以及用了 pnpm run dev
启动 tiny-engine-webservice 的后端服务。
下面这张图的左边是我的 tiny-engine/packages/design-core/
的档案结构,但是没看到有 appInfo.json
。右边开着的文件是 tiny-engine/mockServer/src/services
的 element-plus 组件的相关信息。
Bot detected the issue body's language is not English, translate it automatically.
Only
tiny-engine/mockServer/src/services
containsappInfo.json
. This file contains information about the element-plus component.
But I started the front-end of tiny-engine through pnpm serve:frontend
, and used pnpm run dev
to start the back-end service of tiny-engine-webservice.
The left side of the picture below is the file structure of my tiny-engine/packages/design-core/
, but I don’t see appInfo.json
. The file open on the right is information about the element-plus component of tiny-engine/mockServer/src/services
.
@Cynwell 哦,不好意思。起了webservice之后就不依赖mockServer了。 是不是数据库中没有element组件,user_components这张表
Bot detected the issue body's language is not English, translate it automatically.
@Cynwell Oh, sorry. After starting webservice, we no longer rely on mockServer. Is there no element component in the database, user_components table?
对,database 的 user_components
表格里没有 element-plus。
所以如果需要引用第三方插件 element-plus 的话,我要先运行 pnpm splitMaterials
拆分脚本和 pnpm buildMaterials
构建脚本,然后再 pnpm serve:frontend
?
先运行pnpm splitMaterials,然后运行pnpm buildMaterials,刷新下页面就好了。注意看下.env.local文件中的SQL配置,改为你本地的。
Bot detected the issue body's language is not English, translate it automatically.
First run npm split Materials, then run npm build Materials, and refresh the page. Pay attention to the SQL configuration in the .env.local file and change it to your local one.
我刚刚在 tiny-engine 的目录里运行了 pnpm splitMaterials
和 pnpm buildMaterials
,等 build 好没动静后,手动 Ctrl-C 停止,然后再运行 pnpm serve:frontend
启动 tiny-engine 前端。tiny-engine-data-center 服务一直都开着没改动。
然后浏览器的编辑器界面出现了错误 { "code": "CM001", "message": "系统异常,请稍后重试" }
:
浏览器的编辑器预览界面也出现了错误 { "code": "CM002", "message": "pageInfo schemaContent 对象必须包含schema对象 和 name字符串" }
:
翻查记录,这个是从 tiny-engine-data-center 而来的错误,具体执行记录档在这里 https://pastebin.com/T77QRrtx:
现在前端报错,是哪里出错了?但是我的 database 一直都没改呀?
Bot detected the issue body's language is not English, translate it automatically.
I just ran
pnpm splitMaterials
andpnpm buildMaterials
in the directory of tiny-engine. After the build stopped, I manually stopped it with Ctrl-C, and then ranpnpm serve:frontend
to start the tiny-engine front end. The tiny-engine-data-center service has always been enabled and has not been changed.
Then an error occurred in the browser's editor interface { "code": "CM001", "message": "System exception, please try again later" }
:
There is also an error in the browser's editor preview interface { "code": "CM002", "message": "pageInfo schemaContent object must contain schema object and name string" }
:
Checking the records, this is an error from tiny-engine-data-center. The specific execution record file is here https://pastebin.com/T77QRrtx:
Now the front end reports an error, what went wrong? But my database has not been changed?
@Cynwell 断点调试一下呢,看看是哪条数据有问题
Bot detected the issue body's language is not English, translate it automatically.
@Cynwell Let’s debug with breakpoints to see which piece of data has the problem.
@Cynwell 更新下tiny-engine代码,清理下组件数据,重新执行下buildMaterials
Bot detected the issue body's language is not English, translate it automatically.
@Cynwell Update the tiny-engine code, clean up the component data, and re-execute buildMaterials
可以,预览状态下现在能看到了 Element-plus 的组件了,谢谢!!
Bot detected the issue body's language is not English, translate it automatically.
Okay, you can now see the Element-plus components in the preview state, thank you! !
Environment
win11, Command Prompt
Version
v20.10.0
Version
`-- (empty)
Link to minimal reproduction
按着官方教程:https://opentiny.design/tiny-engine#/help-center/course/backend/51
tiny-engine 的执行记录:https://pastebin.com/kwfFS2aP
tiny-engine-webservice 的执行记录:https://pastebin.com/1SfNTDG5
中间有改动文件
(root)/tiny-engine/packages/design-core/vite.config.js
, 将 Line 15const origin = 'http://localhost:9090/'
改成const origin = 'http://localhost:7011/'
.Step to reproduce
页面 Schema:
What is expected
What is actually happening
Any additional comments (optional)
No response