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

查看:25
本文介绍了带有角度错误 NodeInvocationException 的 aspnetcore:节点调用在 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:节点调用在 60000 毫秒后超时.您可以通过设置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:节点调用在 60000 毫秒后超时.您可以通过设置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() 中索引.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 :)

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

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