[英]ERROR in ./src/app/app.module.ngfactory.js and Can't resolve @ngx-translate instances
I'm trying to do a server side rendering using Angular Universal. 我正在尝试使用Angular Universal进行服务器端渲染。 During the build process I can't resolve this issue: 在构建过程中,我无法解决此问题:
ERROR in ./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve '@ngx-translate/core/index' in '/Users/myUser/Documents/portal/src/app'
Angular CLI: 7.0.6 || Angular CLI:7.0.6 || Node: 9.4.0 || 节点:9.4.0 || Angular: 7.0.4 || 角度:7.0.4 || @ngx-translate/core: 11.0.1 @ ngx-翻译/核心:11.0.1
Note: I tried --aot=false but I had this issue " The --build-optimizer
option cannot be used without --aot
." 注意:我尝试了--aot = false,但遇到了以下问题“ --build-optimizer
选项必须在没有--aot
情况下才能使用。”
Someone can help? 有人可以帮忙吗?
Let me know if you need more info 让我知道您是否需要更多信息
It is possible that it comes from the library exports. 它可能来自库导出。 You can fix it by exporting the modules directly from the files and not from a barrel. 您可以通过直接从文件而不是桶中导出模块来修复它。
Instead of: 代替:
lib/my/my.service.ts
export class MyService
lib/my/index.ts
export { MyService } from './my.service'
lib/index.ts
export { MyService } from './my'
You should try: 你应该试试:
lib/my/my.service.ts
export class MyService
lib/index.ts
export { MyService } from './my/my.service'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.