gpt4 book ai didi

ASP.NET 核心 2 + Angular 4 : NodeInvocationException: Prerendering failed because of error: ReferenceError: window is not defined

转载 作者:太空狗 更新时间:2023-10-29 17:02:33 25 4
gpt4 key购买 nike

我正在尝试使用 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 下的 import 中评论 BrowserAnimationsModule,我的应用程序就可以正常工作,但是一旦我取消评论它,我就会遇到同样的错误。

请问我怎么能把它扔掉,我已经为此工作了 4 天多了。或者建议任何其他 Angular 4 标签输入库我正在使用 ASP.NET Core 2 SPA 模板。

谢谢...

最佳答案

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

关于ASP.NET 核心 2 + Angular 4 : NodeInvocationException: Prerendering failed because of error: ReferenceError: window is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46695079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com