我已经使用Visual Studio Angular Template
创建了项目。我最近把我的Angular
从6更新到了7,把Typescript
更新到了3.1.6。还将Webpack
从3.8.1升级到3.12.0。
现在,当我尝试使用webpack命令进行编译时,我得到了以下错误
ERROR in [at-loader] ./ClientApp/boot.server.ts:30:17
TS2304: Cannot find name 'setImmediate'.
此错误是由boot.server.ts代码引发的
return platformDynamicServer(providers).bootstrapModule(AppModule).then(moduleRef => {
const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);
const state = moduleRef.injector.get(PlatformState);
const zone: NgZone = moduleRef.injector.get(NgZone);
return new Promise<RenderResult>((resolve, reject) => {
zone.onError.subscribe((errorInfo: any) => reject(errorInfo));
appRef.isStable.pipe(first(isStable => isStable)).subscribe(() => {
// Because 'onStable' fires before 'onError', we have to delay slightly before
// completing the request in case there's an error to report
setImmediate(() => {
resolve({
html: state.renderToString()
});
moduleRef.destroy();
});
});
});
});
我试着解决这个问题已经有一段时间了,但是没有成功。任何idea>
https://stackoverflow.com/questions/53622757
复制相似问题