ASP.NET CORE 2 + ANGULAR 4:NodeInvocationException:由于错误导致预渲染失败:ReferenceError:未定义窗口

时间:2017-10-11 18:22:12

标签: asp.net angular web asp.net-core-2.0

我正在尝试使用ngx-chips进行标记输入,但是我在导入BrowserAnimationsModule时遇到了这个问题。

在导入BrowserAnimationsModule时,我收到以下错误:

An unhandled exception occurred while processing the request.

NodeInvocationException: document is not defined
ReferenceError: document is not defined

一旦我在app.module.shared.ts下的导入中评论BrowserAnimationsModule,我的应用程序正常工作,但一旦我取消注释,我就会出现同样的错误。

请问我该如何废弃这个,我已经为此工作了4天以上。 或建议任何其他角度4标签输入库 我正在使用ASP.NET Core 2 SPA模板。

...谢谢

1 个答案:

答案 0 :(得分:18)

在您的视图(Index.cshtml)应用标记中,将asp-prerender-module替换为asp-ng2-prerender-module

相关问题