简体   繁体   English

./src/app/app.module.ngfactory.js中的错误,并且无法解析@ ngx-translate实例

[英]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.

相关问题 为什么我得到 Angular 生产构建错误。/src/app/app.module.ngfactory.js - Angular production build error why I am getting ./src/app/app.module.ngfactory.js Angular 8.2 + Firebase:./src/app/app.module.ngfactory.js 中的 ERROR in ./src/app/app.module.ngfactory.js 错误接近 `ng build --prod` 的过程失败 - Angular 8.2 + Firebase: `ERROR in ./src/app/app.module.ngfactory.js` errors near the end of `ng build --prod` fails the process ./src/main.ts中的ngcli 6.1.3错误-无法解析'./app/app.module.ngfactory' - ngcli 6.1.3 ERROR in ./src/main.ts - Can't resolve './app/app.module.ngfactory' Angular 4错误-./src/main.ts中找不到错误:错误:无法解析'./$$_gendir/app/app.app.module.ngfactory' - Angular 4 error - ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' 错误:无法解析“ C:\\ projects \\ Project-CMS \\ Project.Web \\ src”中的“ ./app/app.module.ngfactory” - Error: Can't resolve './app/app.module.ngfactory' in 'C:\projects\Project-CMS\Project.Web\src' 找不到模块:错误:无法解析'./$$_gendir/app/app.module.ngfactory' - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' ./src/main/webapp/app/app.main.ts 中的 Jhipster webpack 生产错误,找不到模块:错误:无法解析“./app.module.ngfactory” - Jhipster webpack production ERROR in ./src/main/webapp/app/app.main.ts ,Module not found:Error: Can't resolve './app.module.ngfactory' 找不到模块:错误:无法解析“ ./$$_gendir/app/app.app.module.ngfactory” - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' 找不到模块:错误:无法解析'./$$_gendir/app/app.module.ngfactory' - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 找不到模块:错误:无法解析$$ _ gendir \\ app \\ item-receive-return.module.ngfactory.ts' - Module not found: Error: Can't resolve $$_gendir\app\item-receive-return.module.ngfactory.ts'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM