aspnetcore with angular error NodeInvocationException: The Node invocation timed out after 60000ms

Viewed 7067

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

An unhandled exception occurred while processing the request.

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. Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance+d__13.MoveNext()

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.

and red color on this line

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

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

4 Answers

I had the same problem. It might be an issue with the local version of node.

I set my local nodejs version to 5.4.3 and was able to get the app running, try checking your node version using this on your console/terminal:

node -v

I think removing the prerendering tag then running webpack might still be excluding that module from server-side prerendering, so hopefully a newer node version can help run the app as expected without code changes.

Also there's a similar issue here : NodeInvocationException: Attempt to connect to Node timed out

Not exactly an answer to this question, but I had the same issue and came here.

I have Windows HPC pack installed, and that means the node.exe on my PATH was the Windows HPC node command rather than the third-party NodeJS node.exe

This meant I got the timeout as it was running the HPC node command instead of using NodeJS to run webpack. To fix, I removed the path from the PATH environment variable and restarted Visual Studio. I could have reordered the paths, or renamed one of the node.exe, but I don't use the HPC commands from the command line, only from code.

Discussion of the conflict in NodeJS https://github.com/nodejs/node-v0.x-archive/issues/7773

Related