1

我按照这篇文章创建了一个由 ofstudio 发布的自定义助手

https://stackoverflow.com/a/28147370/5335127

当我在车把模板中使用 {{#by_tag}} 两次时,出现以下错误

 ERROR: Can't set headers after they are sent.
 registerAsyncThemeHelper: ghost_head

 Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
    at ServerResponse.header (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:700:10)
    at ServerResponse.send (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:154:12)
    at fn (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:934:10)
    at _stackRenderer (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\hbs.js:524:9)
    at Waiter.callback (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\hbs.js:501:7)
    at Waiter.resolve (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\async.js:43:12)
    at C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\async.js:84:15
    at C:\Ghost\ghost-0.7.1\core\server\helpers\index.js:64:13
    at tryCatcher (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\util.js:24:31)
    at Promise._settlePromiseFromHandler (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:454:31)
    at Promise._settlePromiseAt (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:530:18)
    at Promise._settlePromises (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:646:14)
    at Async._drainQueue (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:177:16)
    at Async._drainQueues (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:187:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:358:17)

Unhandled rejection Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
    at ServerResponse.header (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:700:10)
    at ServerResponse.send (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:154:12)
    at fn (C:\Ghost\ghost-0.7.1\node_modules\express\lib\response.js:934:10)
    at _stackRenderer (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\hbs.js:524:9)
    at Waiter.callback (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\hbs.js:501:7)
    at Waiter.resolve (C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\async.js:43:12)
    at C:\Ghost\ghost-0.7.1\node_modules\express-hbs\lib\async.js:84:15
    at C:\Ghost\ghost-0.7.1\core\server\helpers\index.js:64:13
    at tryCatcher (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\util.js:24:31)
    at Promise._settlePromiseFromHandler (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:454:31)
    at Promise._settlePromiseAt (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:530:18)
    at Promise._settlePromises (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\promise.js:646:14)
    at Async._drainQueue (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:177:16)
    at Async._drainQueues (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:187:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Ghost\ghost-0.7.1\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:358:17)

请帮忙。

该错误与以下帖子有关,但在 ghost express-hbs 实例 registerAsyncHelper 奇怪的哈希

4

0 回答 0