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

升级ngx-masonry至14.0.0后测试报错:ReferenceError: require is not defined

ngx-masonry v14.0.0升级后单元测试报错:ReferenceError: require is not defined

升级ngx-masonry到2022年10月24日发布的v14.0.0稳定版后,运行ng test时所有依赖该库的组件测试均失败,抛出错误:

ReferenceError: require is not defined

相关信息

  • 本次版本升级核心变化:从旧版的ViewEngine构建迁移至Ivy构建
  • 项目基于Angular 14开发
  • 执行npm i ngx-masonry@14.0.0完成更新,无依赖漏洞提示
  • 该问题已在官方代码仓库提交相关issue

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 05:05:27