theme-next-docs icon indicating copy to clipboard operation
theme-next-docs copied to clipboard

hexo server的时候报Template render error : (unknown path) [Line 7, Column 23]

Open itxuye opened this issue 9 years ago • 11 comments
trafficstars

Template render error: (unknown path) [Line 7, Column 23] Error: Unable to call the return value of (posts["first"])["updated"]["toISOString"], which is undefined or falsey at Object.exports.prettifyError (D:\itxuye\node_modules\nunjucks\src\lib.js:34:15) at D:\itxuye\node_modules\nunjucks\src\environment.js:485:31 at root [as rootRenderFunc](eval at %28D:itxuyenode_modulesnunjuckssrcenvironment.js:564:24%29, :161:3) at Obj.extend.render (D:\itxuye\node_modules\nunjucks\src\environment.js:478:15) at Hexo.module.exports (D:\itxuye\node_modules\hexo-generator-feed\lib\generator.js:28:22) at Hexo.tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at Hexo. (D:\itxuye\node_modules\bluebird\js\release\method.js:15:34) at D:\itxuye\node_modules\hexo\lib\hexo\index.js:337:24 at tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at MappingPromiseArray._promiseFulfilled (D:\itxuye\node_modules\bluebird\js\release\map.js:57:38) at MappingPromiseArray.PromiseArray._iterate (D:\itxuye\node_modules\bluebird\js\release\promise_array.js:113:31) at MappingPromiseArray.init (D:\itxuye\node_modules\bluebird\js\release\promise_array.js:77:10) at new MappingPromiseArray (D:\itxuye\node_modules\bluebird\js\release\map.js:25:10) at map (D:\itxuye\node_modules\bluebird\js\release\map.js:152:12) at Function.Promise.map (D:\itxuye\node_modules\bluebird\js\release\map.js:160:12) at D:\itxuye\node_modules\hexo\lib\hexo\index.js:334:20 at tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\itxuye\node_modules\bluebird\js\release\promise.js:504:31) at Promise._settlePromise (D:\itxuye\node_modules\bluebird\js\release\promise.js:561:18) at Promise._settlePromise0 (D:\itxuye\node_modules\bluebird\js\release\promise.js:606:10) at Promise._settlePromises (D:\itxuye\node_modules\bluebird\js\release\promise.js:685:18) at Async._drainQueue (D:\itxuye\node_modules\bluebird\js\release\async.js:138:16) 02:09:00.737 DEBUG Generator: asset 02:09:00.741 DEBUG Database saved 02:09:00.742 FATAL (unknown path) [Line 7, Column 23] Error: Unable to call the return value of (posts["first"])["updated"]["toISOString"], which is undefined or falsey Template render error: (unknown path) [Line 7, Column 23] Error: Unable to call the return value of (posts["first"])["updated"]["toISOString"], which is undefined or falsey at Object.exports.prettifyError (D:\itxuye\node_modules\nunjucks\src\lib.js:34:15) at D:\itxuye\node_modules\nunjucks\src\environment.js:485:31 at root [as rootRenderFunc](eval at %28D:itxuyenode_modulesnunjuckssrcenvironment.js:564:24%29, :161:3) at Obj.extend.render (D:\itxuye\node_modules\nunjucks\src\environment.js:478:15) at Hexo.module.exports (D:\itxuye\node_modules\hexo-generator-feed\lib\generator.js:28:22) at Hexo.tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at Hexo. (D:\itxuye\node_modules\bluebird\js\release\method.js:15:34) at D:\itxuye\node_modules\hexo\lib\hexo\index.js:337:24 at tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at MappingPromiseArray._promiseFulfilled (D:\itxuye\node_modules\bluebird\js\release\map.js:57:38) at MappingPromiseArray.PromiseArray._iterate (D:\itxuye\node_modules\bluebird\js\release\promise_array.js:113:31) at MappingPromiseArray.init (D:\itxuye\node_modules\bluebird\js\release\promise_array.js:77:10) at new MappingPromiseArray (D:\itxuye\node_modules\bluebird\js\release\map.js:25:10) at map (D:\itxuye\node_modules\bluebird\js\release\map.js:152:12) at Function.Promise.map (D:\itxuye\node_modules\bluebird\js\release\map.js:160:12) at D:\itxuye\node_modules\hexo\lib\hexo\index.js:334:20 at tryCatcher (D:\itxuye\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\itxuye\node_modules\bluebird\js\release\promise.js:504:31) at Promise._settlePromise (D:\itxuye\node_modules\bluebird\js\release\promise.js:561:18) at Promise._settlePromise0 (D:\itxuye\node_modules\bluebird\js\release\promise.js:606:10) at Promise._settlePromises (D:\itxuye\node_modules\bluebird\js\release\promise.js:685:18) at Async._drainQueue (D:\itxuye\node_modules\bluebird\js\release\async.js:138:16)

What is the problem?How can i solve it ~~~

itxuye avatar Aug 10 '16 02:08 itxuye

I got the same problem . Anyone can give some help?

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path) [Line 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
    at Object.exports.prettifyError (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/lib.js:34:15)
    at /home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:485:31
    at root [as rootRenderFunc] (eval at <anonymous> (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:564:24), <anonymous>:161:3)
    at Obj.extend.render (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:478:15)
    at Hexo.module.exports (/home/bash/workspace/hexo/baifan/node_modules/hexo-generator-feed/lib/generator.js:28:22)
    at Hexo.tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/method.js:15:34)
    at /home/bash/workspace/hexo/baifan/node_modules/hexo/lib/hexo/index.js:337:24
    at tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:57:38)
    at MappingPromiseArray.PromiseArray._iterate (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise_array.js:77:10)
    at new MappingPromiseArray (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:25:10)
    at map (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:152:12)
    at Function.Promise.map (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:160:12)
    at /home/bash/workspace/hexo/baifan/node_modules/hexo/lib/hexo/index.js:334:20
    at tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:509:31)
    at Promise._settlePromise (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:566:18)
    at Promise._settlePromise0 (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:611:10)
    at Promise._settlePromises (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:690:18)
    at Async._drainQueue (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/async.js:138:16)
FATAL (unknown path) [Line 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
Template render error: (unknown path) [Line 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
    at Object.exports.prettifyError (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/lib.js:34:15)
    at /home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:485:31
    at root [as rootRenderFunc] (eval at <anonymous> (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:564:24), <anonymous>:161:3)
    at Obj.extend.render (/home/bash/workspace/hexo/baifan/node_modules/nunjucks/src/environment.js:478:15)
    at Hexo.module.exports (/home/bash/workspace/hexo/baifan/node_modules/hexo-generator-feed/lib/generator.js:28:22)
    at Hexo.tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/method.js:15:34)
    at /home/bash/workspace/hexo/baifan/node_modules/hexo/lib/hexo/index.js:337:24
    at tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:57:38)
    at MappingPromiseArray.PromiseArray._iterate (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise_array.js:77:10)
    at new MappingPromiseArray (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:25:10)
    at map (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:152:12)
    at Function.Promise.map (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/map.js:160:12)
    at /home/bash/workspace/hexo/baifan/node_modules/hexo/lib/hexo/index.js:334:20
    at tryCatcher (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:509:31)
    at Promise._settlePromise (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:566:18)
    at Promise._settlePromise0 (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:611:10)
    at Promise._settlePromises (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/promise.js:690:18)
    at Async._drainQueue (/home/bash/workspace/hexo/baifan/node_modules/bluebird/js/release/async.js:138:16)

baifan avatar Aug 28 '16 15:08 baifan

I got the same error, too

jiqiujia avatar Aug 31 '16 11:08 jiqiujia

I got the same error, too

Bestfeel avatar Sep 22 '16 12:09 Bestfeel

perhaps you delete _posts hello-world.md file , this will cause problem . how to fix it .

XuYanci avatar Oct 08 '16 05:10 XuYanci

此问题 我好像遇到过,

---
title: test
date: 2016-10-13 12:08:46
tags:
---

这个没有写正确吧

vsxen avatar Oct 13 '16 04:10 vsxen

in _posts ,if there is no file , it will cause this error .

XuYanci avatar Oct 13 '16 12:10 XuYanci

I have encountered the same issue.

I think the cause is: incompatibility of plugins: hexo-generator-sitemap, hexo-generator-feed and hexo3.

So when I comment the two aforementioned plugins, the command "hexo g" passed!

hansomesong avatar Oct 21 '16 10:10 hansomesong

插件 hexo-generate-feed 还有 hexo-generate-sitemap 和 hexo3 不兼容!

jzm1994 avatar Mar 17 '17 21:03 jzm1994

I have encountered the same problem too. Finally I find it's because I deleted all the posts in source/_post/

HJHL avatar May 27 '17 11:05 HJHL

I have encountered the same problem too. But i have file in source/_posts/index.md when i start hexo s -debug, i got this error:

Template render error: (unknown path) [Line 8, Column 25]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
    at Object._prettifyError (/Users/kobetian/blog/node_modules/nunjucks/src/lib.js:36:11)
    at /Users/kobetian/blog/node_modules/nunjucks/src/environment.js:561:19
    at Template.root [as rootRenderFunc] (eval at _compile (/Users/kobetian/blog/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:214:3)
    at Template.render (/Users/kobetian/blog/node_modules/nunjucks/src/environment.js:550:10)
    at Hexo.module.exports (/Users/kobetian/blog/node_modules/hexo-generator-feed/lib/generator.js:40:22)
    at Hexo.tryCatcher (/Users/kobetian/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/kobetian/blog/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/kobetian/blog/node_modules/hexo/lib/hexo/index.js:318:20
    at tryCatcher (/Users/kobetian/blog/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/kobetian/blog/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/kobetian/blog/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/Users/kobetian/blog/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/Users/kobetian/blog/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/Users/kobetian/blog/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/Users/kobetian/blog/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/kobetian/blog/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/kobetian/blog/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:439:21)

Plz help me🤣🤣🤣

kobe-tian avatar Apr 09 '20 06:04 kobe-tian

See also https://github.com/hexojs/hexo-generator-feed/pull/107

stevenjoezhang avatar Jul 14 '20 06:07 stevenjoezhang