GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lowcode-engine/docs/docs/faq/faq009.md at main · Devancn/lowcode-engine

Expand file tree

/

faq009.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
96 lines (83 loc) · 3.37 KB
/

faq009.md

Copy path

File metadata and controls

96 lines (83 loc) · 3.37 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
title 物料出现 Component Not Found 相关报错
sidebar_position 9
tags
FAQ

预览态,antd 资产包按顺序加载,但是没有按顺序执行

资产包按顺序加载,但是没有按顺序执行,导致部分 js 执行的时候,依赖的资源没有准备好,报错了。 传给 @alilc/lowcode-react-renderer 的 components 值为空。

解决方案 LowCodeEngine 升级到 1.0.8

相关 PR:alibaba#383

编辑态,snippets 和注入组件不对应

1.在控制台中输入

AliLowCodeEngine.material.componentsMap

查看物料配置是否正常。

image.png

如果正常继续。 LowCodeEngine 需要升级到 1.0.10

AliLowCodeEngine.project.simulator.renderer.components

看看对应的物料是否存在,如果不存在,排查物料问题。

如果不正常,查看资产包配置,其中资产包中的 components 和 material.componentsMap 生成有关系。

例如,物料配置信息在 @alilc/lowcode-materials 包里面,即需要在 components 中加上下面的代码

"components": [{
  "exportName": "AlilcLowcodeMaterialsMeta",
  "npm": {
    "package": "@alilc/lowcode-materials"
  },
  "url": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.js",
  "urls": {
    "default": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.js",
    "design": "https://alifd.alicdn.com/npm/@alilc/[email protected]/build/lowcode/meta.design.js"
  }
}]

material.componentsMap 不存在相关的组件信息,原因有两个:

  • 没有添加对应的物料到 components 字段中
  • components 配置不正确,需要查看 url 是否正常加载,查看 exportName 是否配置正确,即 window.${exportName} 是否存在。

2.选中组件,在控制台中输入

AliLowCodeEngine.project.currentDocument.selection.getNodes()[0].exportSchema('render')

查看 componentName 是否匹配。

3.调用 rerender 方法

AliLowCodeEngine.project.simulator.rerender()

看一下问题是否恢复。

排查物料问题

找到对应组件的资产包,比如下图的资产包。

{
  "package": "@yingzhi8/lowcode-public-package",
  "version": "0.1.2",
  "library": "BizComps",
  "urls": [
    "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/render/default/view.js",
    "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/render/default/view.css"
  ],
  "editUrls": [
    "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/view.js",
    "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/view.css"
  ],
  "advancedUrls": {
    "default": [
      "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/render/default/view.js",
      "https://unpkg.com/@yingzhi8/[email protected]/build/lowcode/render/default/view.css"
    ]
  },
  "advancedEditUrls": {}
}

查看 urls 是否加载

通过查看控制台,看加载的 urls

library 配置是否正确

library 是可以在画布上访问到全局变量,确定 library 是否正确,在控制台输入:

AliLowCodeEngine.project.simulator.contentWindow.${library}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.