我有一个简单的列表视图,其中I(尝试)使用mutache呈现含有5个结果的列表的输出。

function(head, req) {
  var row,
      mustache = require("vendor/couchapp/lib/mustache.js"),
      template = "<li>{{project}} {{version}} {{description}}</li>";

   while(row = getRow()) {
    send(mustache.to_html(template,row));
   }
}

这导致超时:

[error] [<0.22977.0>] OS Process Error <0.22858.0> :: {os_process_error,"OS process timed out."}

当我尝试

function(head, req) {
  var row,
      template = "<li>{{project}} {{version}} {{description}}</li>";

   while(row = getRow()) {
     send("Hello");
   }
}

这很好地打印5X你好。

我范围缩小到要求语句加载模板代码。

谁能给我哪里timout是来自线索?

------ -------解决

require呼叫不喜欢”的.js'的代码来指代的文件名的文件扩展名。

它更改为:

function(head, req) {
  var row,
      mustache = require("vendor/couchapp/lib/mustache"),
      template = "<li>{{project}} {{version}} {{description}}</li>";

   while(row = getRow()) {
    send(mustache.to_html(template,row));
   }
}

固定的问题。

有帮助吗?

解决方案

在需要提供函数将.js扩展因此它不应该在参数串进行说明。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top