自定义solution,通过设计器插件使用时报错
详细描述 bug
请提供清晰且精确的 bug 描述
自定义solution,通过自定义设计器插件的方式使用时出现报错
如何复现 bug?
详细复现步骤: 1、使用 npx @alilc/lowcode-code-generator init-solution testSolution 初始化项目。 2、发包之后,在 designer 中使用。 关键代码如下:
import testSolution from 'testSolution';
// 开启出码功能
await plugins.register(testSolution, {});
3、执行 npm run start 启动 designer,出现报错,报错内容如下:
WARNING Compiled with 2 warnings 11:32:07
warning in ./node_modules/_@[email protected]@@alilc/lowcode-code-generator/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
warning in ./node_modules/_@[email protected]@@alilc/lowcode-code-generator/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
ERROR Failed to compile with 2 errors 11:32:07
This dependency was not found:
* fs in ./node_modules/_@[email protected]@@alilc/lowcode-code-generator/es/index.js, ./node_modules/[email protected]@snapdragon/lib/source-maps.js
To install it, you can run: npm install --save fs
预期行为
请清晰和精确的描述你预期的行为
可以正常使用 自定义 solution.
bug 截图

请提供如下信息
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- @alilc/lowcode-engine: 1.0.18
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
建议先尝试把 testSolution 在 node 端可以正常运行,再去弄 browser 里的吧,browser 里可能会有一些约束~
请问这个问题怎么解决的呢?
- 先按照 node 端可以跑通的标准把自定义 solution 搞好;
- 再看看 browser 上如何打包这个 solution,参考 https://github.com/alibaba/lowcode-code-generator-demo 的代码;
- 先按照 node 端可以跑通的标准把自定义 solution 搞好;
- 再看看 browser 上如何打包这个 solution,参考 https://github.com/alibaba/lowcode-code-generator-demo 的代码;
node端出码没问题,现在就是生成的包 接入 lowcode-code-generator-demo这个项目的时候报错
这个你自己研究研究。。。standalone 版本似乎是没有 fs polyfill
这个你自己研究研究。。。standalone 版本似乎是没有 fs polyfill
g构建的时候忽略了这个,solution 脚手架生成的是esm包,是不是可以考虑生成包的地方优化