繁体   English   中英

由于相对路径,angular 生产构建在 Nx 工作区中失败

[英]angular production build fails in Nx workspace due relative path

当我在我们的 nx 工作区 (v11.x) 中为 angular (v11.x) 库之一触发生产构建时,我收到以下错误:

nx run i18n-components:build:production 
Building Angular Package

------------------------------------------------------------------------------
Building entry point '@smallstack/i18n-components'
------------------------------------------------------------------------------
√ Compiling TypeScript sources through NGC
× Bundling to FESM2015
ERROR: Could not resolve '../../../../../../dist/libs/axios-api-client/src/index' from dist\libs\components\i18n-components\esm2015\lib\stores\locale.store.js
Could not resolve '../../../../../../dist/libs/axios-api-client/src/index' from dist\libs\components\i18n-components\esm2015\lib\stores\locale.store.js

———————————————————————————————————————————————

>  NX   ERROR  Running target "build" failed

查看 locale.store.js 中的locale.store.js似乎不是通过 tsconfig->paths 使用 package 名称,而是尝试通过相对路径查找文件。

我发现了问题......如果你有一个服务是@Injectable({ providedIn: "root" })@Injectable({ providedIn: "platform" })需要一个不是的服务,你明白了错误。

我猜,根服务应该只依赖于其他根服务?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM