Hexo(零) 问题列表

Cannot set property ‘lastIndex’ of undefined

问题详细:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 maple @ iMac in ~/Maple [11:05:09]
$ hexo g
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot set property 'lastIndex' of undefined
at highlight (/Users/maple/Maple/node_modules/highlight.js/lib/highlight.js:511:35)
at /Users/maple/Maple/node_modules/highlight.js/lib/highlight.js:561:21
at Array.forEach (<anonymous>)
at Object.highlightAuto (/Users/maple/Maple/node_modules/highlight.js/lib/highlight.js:560:40)
at /Users/maple/Maple/node_modules/hexo-util/lib/highlight.js:117:25
at highlight (/Users/maple/Maple/node_modules/hexo-util/lib/highlight.js:120:7)
at highlightUtil (/Users/maple/Maple/node_modules/hexo-util/lib/highlight.js:22:14)
at /Users/maple/Maple/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15
at String.replace (<anonymous>)
at Hexo.backtickCodeBlock (/Users/maple/Maple/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:14:31)
at Hexo.tryCatcher (/Users/maple/Maple/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/Users/maple/Maple/node_modules/bluebird/js/release/method.js:15:34)
at /Users/maple/Maple/node_modules/hexo/lib/extend/filter.js:68:35
at tryCatcher (/Users/maple/Maple/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/Users/maple/Maple/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/Users/maple/Maple/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/Users/maple/Maple/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/maple/Maple/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/maple/Maple/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/Users/maple/Maple/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/Users/maple/Maple/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/Users/maple/Maple/node_modules/bluebird/js/release/async.js:143:10)

修改方案:

在 _config.yml 修改 auto_detect: 的 true 为 false

1
2
3
4
5
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:
-------------本文结束谢谢欣赏-------------
Alice wechat