V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
locochen
V2EX  ›  Node.js

hexo generate /server csrf_token 错误。 Template render error: Error: Unable to call `csrf_token`

  •  
  •   locochen · 2015-07-17 23:33:50 +08:00 · 4215 次点击
    这是一个创建于 3416 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用hexo做blog系统一段时间了,某一天使用
    命令 hexo g , hexo s 都报如下错误:

    FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
    Template render error: Error: Unable to call `csrf_token`, which is undefined or falsey
        at Object.callWrap (/www/blog/node_modules/hexo/node_modules/nunjucks/src/runtime.js:223:15)
        at root [as rootRenderFunc] (eval at <anonymous> (/www/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:450:24), <anonymous>:8:67)
        at null.<anonymous> (/www/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:387:18)
        at Object.exports.withPrettyErrors (/www/blog/node_modules/hexo/node_modules/nunjucks/src/lib.js:24:16)
        at Obj.extend.render (/www/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:374:20)
        at Obj.extend.renderString (/www/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:261:21)
        at /www/blog/node_modules/hexo/lib/extend/tag.js:56:9
        at tryCatcher (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:26:23)
        at Promise._resolveFromResolver (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:476:31)
        at new Promise (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:69:37)
        at Tag.render (/www/blog/node_modules/hexo/lib/extend/tag.js:55:10)
        at Object.tagFilter [as onRenderEnd] (/www/blog/node_modules/hexo/lib/hexo/post.js:253:16)
        at /www/blog/node_modules/hexo/lib/hexo/render.js:55:19
        at tryCatcher (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:26:23)
        at Promise._settlePromiseFromHandler (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:503:31)
        at Promise._settlePromiseAt (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:577:18)
        at Promise._settlePromises (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:693:14)
        at Async._drainQueue (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:123:16)
        at Async._drainQueues (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:133:10)
        at Immediate.Async.drainQueues [as _onImmediate] (/www/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
        at processImmediate [as _immediateCallback] (timers.js:358:17)
    
    2 条回复    2015-08-10 22:07:30 +08:00
    locochen
        1
    locochen  
    OP
       2015-08-10 22:03:50 +08:00
    经过这么长时间的检查,发现时source/_post/文件下某个xxx.md文件的格式不对。导致出现这么奇怪的错误。
    locochen
        2
    locochen  
    OP
       2015-08-10 22:07:30 +08:00
    删除掉就好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2848 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 06:59 · PVG 14:59 · LAX 22:59 · JFK 01:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.