【发布时间】:2018-04-13 15:32:42
【问题描述】:
我正在开发支持使用 angular cli (1.7.3) 进行服务器端渲染的应用程序。
在运行命令npm start build 时会成功创建,但在服务器上运行应用程序时会抛出错误显示
无法读取未定义的属性“moduleType”
我假设错误来自server.ts 文件,我在该文件中导入AppServerModuleNgFactory,如下所示:
const { AppServerModuleNgFactory } = (module as any).exports;
// import { AppServerModuleNgFactory } from '../dist/ngfactory/src/app/app.server.module.ngfactory'
PS:这适用于 Angular 4.4.0,但不适用于 5.2.0
如果需要更多信息,请告诉我。
【问题讨论】:
标签: angular