文章目录
个人博客: https://mmmmmm.me
源码: https://github.com/dataiyangu/dataiyangu.github.io
发布文章遇到:
Unhandled rejection Template render error: (unknown path) [Line 265, Column 814]
unexpected token: .
at Object._prettifyError (/Users/leesin/Desktop/blog/node_modules/nunjucks/src/lib.js:36:11)
at Template.render (/Users/leesin/Desktop/blog/node_modules/nunjucks/src/environment.js:524:21)
at Environment.renderString (/Users/leesin/Desktop/blog/node_modules/nunjucks/src/environment.js:362:17)
at Promise (/Users/leesin/Desktop/blog/node_modules/hexo/lib/extend/tag.js:66:9)
at Promise._execute (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:79:10)
at Tag.render (/Users/leesin/Desktop/blog/node_modules/hexo/lib/extend/tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (/Users/leesin/Desktop/blog/node_modules/hexo/lib/hexo/post.js:230:16)
at Promise.then.then.result (/Users/leesin/Desktop/blog/node_modules/hexo/lib/hexo/render.js:65:19)
at tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
一般是markdown合适不对,找到对应的文件(上面不显示,可以通过二分法进行删除排除法,找到错误的),删除,google说是/{/{/}/}不能在{}中包{}
发布文章的时候出现错误:
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)
_posts文件中不能一篇文章都没有,可能是我上面的二分法给全部删除文章了出现问题。
代码推送到github,hexo g -d 半天推送不上去
停留在这里不动
[master d43a5a4] Site updated: 2019-01-27 19:19:34
146 files changed, 168 insertions(+), 168 deletions(-)
家里的网络平常上github有时候都成问题,所以之前就出现过,到公司,用公司的网就没问题了。
记录一次hexo+coding hexo s本都没问题,hexo g -d 样式并未改变的问题。
问题背景:
昨天晚上,将hexo相关的改变push到了coding上,本来我也知道push上去是有一定的反应时间的,不能马上改变,过了一晚上还是不行,第二天通过问客服,得到了解决的办法。
解决方法:
将coding pages停止服务重新开启,重新拉取代码,重新配置域名。
另外,修改代码,白天push上去改变的比晚上快很多,具体原因不详~
hexo 问题记录:hexo server的时候报Template render error : (unknown path) [Line 7, Column 23
emplate 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
可能你删除_posts文件夹下的 hello-world.md文件,_posts文件夹下面不能一个文件都没有。
hexo发布文章报错记录:Unhandled rejection TypeError: Cannot set property ‘lastIndex’ of undefined
错误代码:
Unhandled rejection TypeError: Cannot set property 'lastIndex' of undefined
at highlight (/Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:511:35)
at /Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:561:21
at Array.forEach (<anonymous>)
at Object.highlightAuto (/Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:560:40)
at /Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:117:25
at highlight (/Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:120:7)
at highlightUtil (/Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:22:14)
at /Users/leesin/Desktop/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15
at String.replace (<anonymous>)
at Hexo.backtickCodeBlock (/Users/leesin/Desktop/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:14:31)
at Hexo.tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/method.js:15:34)
at Promise.each.filter (/Users/leesin/Desktop/blog/node_modules/hexo/lib/extend/filter.js:63:65)
at tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:606:10)
at _drainQueueStep (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:142:12)
at _drainQueue (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:131:9)
Unhandled rejection TypeError: Cannot set property 'lastIndex' of undefined
at highlight (/Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:511:35)
at /Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:561:21
at Array.forEach (<anonymous>)
at Object.highlightAuto (/Users/leesin/Desktop/blog/node_modules/highlight.js/lib/highlight.js:560:40)
at /Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:117:25
at highlight (/Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:120:7)
at highlightUtil (/Users/leesin/Desktop/blog/node_modules/hexo-util/lib/highlight.js:22:14)
at /Users/leesin/Desktop/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15
at String.replace (<anonymous>)
at Hexo.backtickCodeBlock (/Users/leesin/Desktop/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:14:31)
at Hexo.tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/method.js:15:34)
at Promise.each.filter (/Users/leesin/Desktop/blog/node_modules/hexo/lib/extend/filter.js:63:65)
at tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/promise.js:606:10)
at _drainQueueStep (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:142:12)
at _drainQueue (/Users/leesin/Desktop/blog/node_modules/bluebird/js/release/async.js:131:9)
解决:
hexo根目录下面的 auto_detect设置为false
这个配置是用来自动查错的。
原因:
md文章的格式不对,可是字数很多,错误可能是代码块的格式不对,这个时候就把这个配置置为false就行了。