首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >更新后,webpack和Angular收到错误,无法找到名称'setImmediate‘

更新后,webpack和Angular收到错误,无法找到名称'setImmediate‘
EN

Stack Overflow用户
提问于 2018-12-05 07:07:21
回答 3查看 1.6K关注 0票数 1

我已经使用Visual Studio Angular Template创建了项目。我最近把我的Angular从6更新到了7,把Typescript更新到了3.1.6。还将Webpack从3.8.1升级到3.12.0

现在,当我尝试使用webpack命令进行编译时,我得到了以下错误

代码语言:javascript
运行
复制
ERROR in [at-loader] ./ClientApp/boot.server.ts:30:17
        TS2304: Cannot find name 'setImmediate'.

此错误是由boot.server.ts代码引发的

代码语言:javascript
运行
复制
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>

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53622757

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档