You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加ant-design-pro@2.3.2至ShadowCLJS项目遇依赖缺失错误求助

解决ShadowCLJS引入ant-design-pro ^2.3.2时的依赖错误

问题原因

ant-design-pro ^2.3.2依赖的BizCharts在其umd格式包中使用了相对路径引用./factoryWithThrowingShims,ShadowCLJS默认无法正确解析这类umd包内部的相对依赖引用,从而触发错误。

解决方案

  • 强制使用BizCharts的esm格式包
    在ShadowCLJS的配置文件shadow-cljs.edn中添加js-resource配置,指定BizCharts加载esm模块:

    :js-options {:resolve {"bizcharts" {:target :esm :file "node_modules/bizcharts/es/index.js"}}}
    
  • 清理缓存并重新构建
    执行命令清除ShadowCLJS缓存,避免旧的umd包残留:

    npx shadow-cljs clean
    

    之后重新启动开发服务或执行生产构建:

    npx shadow-cljs watch app # 开发模式
    # 或
    npx shadow-cljs release app # 生产构建
    
  • 降级BizCharts版本(备选方案)
    若上述方法无效,可尝试将BizCharts降级到兼容ShadowCLJS的版本(如^3.5.9),修改package.json中的依赖后执行npm install重新安装。


内容的提问来源于stack exchange,提问作者Kannan Ramamoorthy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 23:33:30