alibaba / alibaba/lowcode-engine

设计器组件集成到微服务后无法正常工作

Open
#1,268 7 comments 0 reactions 0 assignees View on GitHub
insufficient information
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

问题原因://g.alicdn.com/ali-lowcode/ali-lowcode-engine/1.0.63/engine-core.js
这个js里面又段逻辑:
const publicPath = (document.currentScript as HTMLScriptElement)?.src.replace(/^(.*\/)[^/]+$/, '$1');

export function getPublicPath(): string {
return publicPath || '';
}

这个逻辑在应用单独启动时候,能够正确计算出simulator js的地址:https://g.alicdn.com/ali-lowcode/ali-lowcode-engine/1.0.63/react-simulator-renderer.js

当集成到主应用后,这个js的地址会错误,主要是因为publicPath = ''

想咨询下以下几个问题:
1)engine-core.js的执行时机,由于这个是在主应用加载的,是不是在子应用页面渲染的时候,计算会出错
2) 如何解决此问题

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the engine-core.js snippet and its getPublicPath() entry point, especially document.currentScript, then compare its value during standalone startup and microservice integration. Reproduce both loading paths and trace how the simulator JavaScript URL is derived. Done means the execution timing and the expected integration behavior are confirmed well enough to define a specific fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.