angular - 从 1.0.46 升级到 1.0.47 后带有 Angular (9) 的 ServiceStack 编译错误
问题描述
在我们的 package.json 中,我们用来^
声明包引用@servicestack/client
。自上次将 ServiceStack 存储库更新到新版本以来,1.0.47
我们收到以下错误:
ERROR in ./node_modules/@servicestack/client/dist/index.js
Module not found: Error: Can't resolve 'fs' in 'MyProjectPath...\node_modules\@servicestack\client\dist'
ERROR in ./node_modules/@servicestack/client/dist/index.js
Module not found: Error: Can't resolve 'path' in 'MyProjectPath...\node_modules\@servicestack\client\dist'
如果我们在构建的package.json
修复中定义版本@servicestack/client": "1.0.46
运行良好
解决方案
看起来 Angular 的 AOT 编译器仍然对它不在运行时运行的代码进行静态引用评估。v1.0.48 通过使用动态需求分辨率来解决这个问题。
现在可以从@servicestack/client
npm 上的latest 获得
"dependencies": {
"@servicestack/client": "^1.0.48",
},
推荐阅读
- facebook-graph-api - 应用程序不再从 Graph API 获取数据 & 填写审核时出现问题
- xslt - 如何将命名空间和 xsi 添加到没有命名空间的传入 XML
- r - geom_smooth 线条颜色与展开颜色不同
- android - 制作适合 Android 4.2.2 版本的 PhoneGap/Cordova 项目
- jquery - 当引导轮播选择器选择了类时启动函数
- xquery - marklogic 森林中所有文档名称的列表
- google-sheets-api - 在 Saas 应用程序中使用 Google 表格
- excel - VBA Excel - 从多个工作簿打开并复制到一个摘要表(粘贴在顺序原始文件上)
- apache - 在服务器代码中打印变量
- excel - Excel vba - 摆脱 .activate 和 .select