在ASP.NET CORE中启用asp-prerender-module给出错误

时间:2018-02-01 06:38:18

标签: angular asp.net-core

我在ASP.NET CORE中启用asp-prerender-module时遇到此错误:

  

NodeInvocationException:由于错误,预渲染失败:   TypeError:无法读取属性' document'未定义的   Rb.object.module.exports.module.exports at   Function.FusionChartsService.resolveFusionChartsCore at   Function.FusionChartsModule.fcRoot

2 个答案:

答案 0 :(得分:0)

我遇到的唯一解决方案是更改index.cshtml

<!--  remove this line
<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>
    -->
<!-- replace with -->
<app>Loading...</app>

<script src="~/dist/vendor.js" asp-append-version="true"></script>
@section scripts {
    <script src="~/dist/main-client.js" asp-append-version="true"></script>
}

答案 1 :(得分:0)

在我使用ASP.NET Core 2和Angular的情况下,这可行。

<app asp-ng2-prerender-module="ClientApp/dist/main-server">Loading...</app>
相关问题