ASP.NET CORE 2 + ANGULAR 4:NodeInvocationException:预渲染失败,因为错误:ReferenceError:窗口未定义
问题描述:
我想使用ngx芯片进行标记输入,但我在导入BrowserAnimationsModule时遇到了这个问题。ASP.NET CORE 2 + ANGULAR 4:NodeInvocationException:预渲染失败,因为错误:ReferenceError:窗口未定义
在进口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模板。
谢谢...
答
在你看来的(Index.cshtml)的应用程序标签,更换asp-prerender-module
与asp-ng2-prerender-module
。
谢谢,这固定与我的ASP.NET Core 2和SPA模板。 – Harv
asp-ng2-prerender-module是一个新的关键字还是你的“解决方案”只是简单地禁用了SSR? – Hayha