带角度错误的aspnetcore NodeInvocationException:60000毫秒后,节点调用超时 [英] aspnetcore with angular error NodeInvocationException: The Node invocation timed out after 60000ms

查看:146
本文介绍了带角度错误的aspnetcore NodeInvocationException:60000毫秒后,节点调用超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用yo generator-aspnetcore-spa 一旦我运行该应用程序,我就会遇到问题

i'm using yo generator-aspnetcore-spa once i run the app i got problem

处理请求时发生未处理的异常.

An unhandled exception occurred while processing the request.

NodeInvocationException:60000ms之后,节点调用超时. 您可以通过设置超时时间来更改超时时间 NodeServicesOptions上的InvocationTimeoutMilliseconds属性.

NodeInvocationException: The Node invocation timed out after 60000ms. You can change the timeout duration by setting the InvocationTimeoutMilliseconds property on NodeServicesOptions.

第一步调试是确保您的Node.js功能正常 始终调用提供的回调(或引发异常) 同步),即使遇到错误也是如此.否则,.NET 代码无法知道它已完成还是失败. Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance + d__13.MoveNext()

The first debugging step is to ensure that your Node.js function always invokes the supplied callback (or throws an exception synchronously), even if it encounters an error. Otherwise, the .NET code has no way to know that it is finished or has failed. Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance+d__13.MoveNext()

NodeInvocationException:60000ms之后,节点调用超时. 您可以通过设置超时时间来更改超时时间 NodeServicesOptions上的InvocationTimeoutMilliseconds属性.这 调试的第一步是确保您的Node.js函数始终 调用提供的回调(或同步引发异常), 即使遇到错误.否则,.NET代码将无法 知道它已经完成或失败了.

NodeInvocationException: The Node invocation timed out after 60000ms. You can change the timeout duration by setting the InvocationTimeoutMilliseconds property on NodeServicesOptions. The first debugging step is to ensure that your Node.js function always invokes the supplied callback (or throws an exception synchronously), even if it encounters an error. Otherwise, the .NET code has no way to know that it is finished or has failed.

和这行上的红色

AspNetCore._Views_Home_Index_cshtml + d__31.MoveNext()在 Index.cshtml + ViewData ["Title"] =主页";

AspNetCore._Views_Home_Index_cshtml+d__31.MoveNext() in Index.cshtml + ViewData["Title"] = "Home Page";

这是我的package.json的样子

this is how my package.json look like

{
  "name": "WebApplicationBasic",
  "version": "0.0.0",
  "dependencies": {
    "@angular/animations": "^4.3.0",
    "@angular/common": "^4.3.0",
    "@angular/compiler": "^4.3.0",
    "@angular/core": "^4.3.0",
    "@angular/forms": "^4.3.0",
    "@angular/http": "^4.3.0",
    "@angular/platform-browser": "^4.3.0",
    "@angular/platform-browser-dynamic": "^4.3.0",
    "@angular/platform-server": "^4.3.0",
    "@angular/router": "^4.3.0",
    "@types/node": "^7.0.38",
    "angular2-template-loader": "^0.6.2",
    "aspnet-prerendering": "^2.0.6",
    "aspnet-webpack": "^1.0.29",
    "awesome-typescript-loader": "^3.2.1",
    "bootstrap": "^3.3.7",
    "css": "^2.2.1",
    "css-loader": "^0.28.4",
    "es6-shim": "^0.35.3",
    "event-source-polyfill": "0.0.9",
    "expose-loader": "^0.7.3",
    "extract-text-webpack-plugin": "^2.1.2",
    "file-loader": "^0.11.2",
    "html-loader": "^0.4.5",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^3.2.1",
    "json-loader": "^0.5.4",
    "ng-snotify": "^2.0.3",
    "ngx-cookie": "^1.0.0",
    "preboot": "^4.5.2",
    "raw-loader": "^0.5.1",
    "reflect-metadata": "^0.1.10",
    "rxjs": "^5.4.2",
    "style-loader": "^0.17.0",
    "to-string-loader": "^1.1.5",
    "typescript": "^2.4.1",
    "url-loader": "^0.5.9",
    "webpack": "^2.7.0",
    "webpack-hot-middleware": "^2.18.2",
    "webpack-merge": "^4.1.0",
    "zone.js": "^0.8.14"
  }
}

我的应用程序运行正常,我不知道出现此问题的原因是什么

my app was work fine and i don't no what is the reason of this problem

推荐答案

问题出在aspnet-prerendering模块中 在查看>>首页>> Index.csHtml

The problem was in aspnet-prerendering module it looks like this in View>>Home>>Index.csHtml

<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>

然后当我将其删除时,该应用程序运行正常

Then when i removed it the app works fine

<app>Loading...</app>

,但是当然没有服务器端渲染 因此,当我完成应用程序的开发后,就在项目的根目录中写入了此命令

but there is no server-side rendering of course by this so when i finished from developing the app i write this command in root directory of my project

webpack --config webpack.config.vendor.js
webpack

并恢复了

<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>

,它应该按原样工作:)

and it works as it should be :)

这篇关于带角度错误的aspnetcore NodeInvocationException:60000毫秒后,节点调用超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆