[英]Getting Node invocation timed out error when invoking JS file using Microsoft.AspNetCore.NodeServices
Title Getting Node invocation timed out error when invoking JS file using Microsoft.AspNetCore.NodeServices 使用Microsoft.AspNetCore.NodeServices调用JS文件时, 标题获取节点调用超时错误
Functional impact I developed application which is using NodeServices and deployed it on Azure using following article: https://code.msdn.microsoft.com/How-to-export-HTML-to-PDF-c5afd0ce 功能影响我开发了使用NodeServices的应用程序,并使用以下文章将其部署在Azure上: https ://code.msdn.microsoft.com/How-to-export-HTML-to-PDF-c5afd0ce
It's working locally, but not on deployed version. 它在本地运行,但不适用于已部署的版本。 Getting node time out error:
获取节点超时错误:
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. | Source: Microsoft.AspNetCore.NodeServices
Expected result PDF should be created. 预期结果 PDF应该被创建。
Actual result NodeService throwing timeout error 实际结果 NodeService抛出超时错误
But still getting Timeout error on deployed version. 但是仍然在部署版本上出现超时错误。 Any help would be appreciated.
任何帮助,将不胜感激。 Thanks.
谢谢。
You can specify a timeout when adding NodeServices to the service container - You can also set an ILogger there which might help you debug the problem : 您可以在将NodeServices添加到服务容器时指定超时-您还可以在那里设置ILogger,这可能有助于您调试问题:
services.AddNodeServices(options =>
{
options.InvocationTimeoutMilliseconds = TimeSpan.FromMinutes(5).Milliseconds;
options.NodeInstanceOutputLogger = log;
});
PhantomJS is not supported on Azure Web App. Azure Web App不支持PhantomJS。 More information here .
更多信息在这里 。
I ended up using Azure Web App for Containers . 我最终将Azure Web App用于容器 。
Here's my blogpost on how to do it in ASP.NET Core using NodeServices on docker: Link . 这是我的博客文章,介绍如何在Docker上使用NodeServices在ASP.NET Core中执行此操作: Link 。
(It uses another node package though). (尽管它使用另一个节点包)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.