ref: https://travis-ci.org/Xuanwo/xuanwo.github.io/builds/95182069
build 400, historic time
I meet a TypeError: Cannot set property 'lastIndex' of undefined error, and error message as below
41.76s$ 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 (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:460:35)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:513:21
at Array.forEach (native)
at Object.highlightAuto (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:509:20)
at highlight (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo-util/lib/highlight.js:98:19)
at module.exports (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo-util/lib/highlight.js:21:14)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:49:15
at String.replace (native)
at Hexo.backtickCodeBlock (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31)
at Hexo.tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Hexo.<anonymous> (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/method.js:15:34)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/extend/filter.js:68:35
at tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Object.gotValue (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/reduce.js:145:18)
at Object.gotAccum (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/reduce.js:134:25)
at Object.tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Promise._settlePromiseFromHandler (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:489:31)
at Promise._settlePromise (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:546:18)
at Promise._settlePromiseCtx (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:583:10)
at Async._drainQueue (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:134:12)
at Async._drainQueues (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:139:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
The command "hexo g" exited with 1.
60.72s$ hexo d
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 (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:460:35)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:513:21
at Array.forEach (native)
at Object.highlightAuto (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/highlight.js/lib/highlight.js:509:20)
at highlight (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo-util/lib/highlight.js:98:19)
at module.exports (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo-util/lib/highlight.js:21:14)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:49:15
at String.replace (native)
at Hexo.backtickCodeBlock (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31)
at Hexo.tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Hexo.<anonymous> (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/method.js:15:34)
at /home/travis/build/Xuanwo/xuanwo.github.io/node_modules/hexo/lib/extend/filter.js:68:35
at tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Object.gotValue (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/reduce.js:145:18)
at Object.gotAccum (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/reduce.js:134:25)
at Object.tryCatcher (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/util.js:11:23)
at Promise._settlePromiseFromHandler (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:489:31)
at Promise._settlePromise (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:546:18)
at Promise._settlePromiseCtx (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/promise.js:583:10)
at Async._drainQueue (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:134:12)
at Async._drainQueues (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:139:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/travis/build/Xuanwo/xuanwo.github.io/node_modules/bluebird/js/release/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
The command "hexo d" exited with 1.
@tommy351
set auto_detect to false fixed.
and test results are as below:
before(3.1.1):
INFO Files loaded in 41 s
INFO 731 files generated in 24 s
Elapsed time 2 min 6 sec
after(3.2.0-beta.2):
INFO Files loaded in 6.54 s
INFO 731 files generated in 25 s
Elapsed time 1 min 20 sec
This is the cold start time, as the cache added, hot start will be quicker.
I think we should recommend setting highlight.js's auto detect to false in the document.
It is causing quite a lot of issues.
Yes, It used to save a lot time for don't need to choose language, but at this time, it looks like just resulting more and more problems.
It's disabled by default in Hexo 3.2.
@tommy351 do you mean disabling the config?
It's still true in hexo-starter.
https://github.com/hexojs/hexo-starter/blob/master/_config.yml#L43
hexo-starter is not updated yet. But it has been disabled in hexo core.
https://github.com/hexojs/hexo/blob/master/lib/hexo/default_config.js#L37
But the default config will be overwritten by config value, isn't it?
I'll create PR on hexo-starter.
I think we can remove the auto-detect option from _config.yml, and educate people form the rule that add specific language for codeblocks.
@Xuanwo I second the idea. We can override the value and state in documentation that it will be hardcoded. Actually we could also set lang to plain if it is missing.
Track in #1786
I meet this problem too. I have been troubled for a whole day. Thanks very much. It's working!!
set auto_detect to false solved my problem.
set auto_detect to false solved my problem.
met this prob, thank you!
i met this issue too.And my problem was due to that i didn't specify language for the code in markdown.so,you should specify your code language.May it can help you.
I have solved the problem by changing auto_detect to false too~
Most helpful comment
set
auto_detectto false fixed.and test results are as below:
before(3.1.1):
after(3.2.0-beta.2):
This is the cold start time, as the cache added, hot start will be quicker.