我有这个项目https://github.com/damirkusar/AngularMeetsNetCore/tree/AngularRc4与 Angular 4 RC.4 和 .net 核心。我从 Beta 8 更新了它,删除了通用的东西。我在没有预渲染的情况下工作,但没有启用预渲染。
如果您在此项目中启用预渲染:WebApp/Views/Home/Index.cshtml
通过将其添加到应用程序元素
asp-prerender-module="ClientApp/dist/main-server"
所以整个事情看起来像这样:
<app asp-prerender-module="ClientApp/dist/main-server">
<div class='custom-modal' style="background: white">
<div class="loader absolut-center"></div>
</div>
</app>
我收到以下错误:
Exception: Call to Node module failed with error: Prerendering failed because of error: Error: Cannot find module '@angular/animations/browser'
at new Error (native)
at Function.Module._resolveFilename (module.js:469:15) [<root>]
at Function.Module._load (module.js:417:25) [<root>]
at Module.require (module.js:497:17) [<root>]
at require (internal/module.js:20:19) [<root>]
at Object.<anonymous> (C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:766:18) [<root>]
at __webpack_require__ (C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:20:30) [<root>]
at Object.<anonymous> (C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:2088:1) [<root>]
at __webpack_require__ (C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:20:30) [<root>]
at C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:66:18 [<root>]
at Object.<anonymous> (C:\Users\damir\Code\AngularMeetsNetCore\WebApp\ClientApp\dist\main-server.js:69:10) [<root>]
at Module._compile (module.js:570:32) [<root>]
at Object.Module._extensions..js (module.js:579:10) [<root>]
at Module.load (module.js:487:32) [<root>]
我必须在哪里将 @angular/animation/browser 包含到 SSR 中才能再次工作?