sisyphsu / hexo-enhancer

hexo enhance plugin
MIT License
38 stars 7 forks source link

Next 8.x与插件hexo-enchancer不兼容 #10

Open suyin-long opened 4 years ago

suyin-long commented 4 years ago

Next 8.x与插件hexo-enchancer不兼容!

出现的问题

安装Next 8.x后再安装插件hexo-enchancer,然后执行hexo clean && hexo g && hexo s语句会报错,错误代码:

FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
ReferenceError: src is not defined
    at filterPost (E:\Hexo\node_modules\hexo-enhancer\index.js:60:5)
    at Hexo.<anonymous> (E:\Hexo\node_modules\hexo-enhancer\index.js:67:9)   
    at Hexo.tryCatcher (E:\Hexo\node_modules\bluebird\js\release\util.js:16:23)                                                                           
    at Hexo.<anonymous> (E:\Hexo\node_modules\bluebird\js\release\method.js:15:34)                                                                        
    at E:\Hexo\node_modules\hexo\lib\extend\filter.js:62:52                  
    at tryCatcher (E:\Hexo\node_modules\bluebird\js\release\util.js:16:23)   
    at Object.gotValue (E:\Hexo\node_modules\bluebird\js\release\reduce.js:166:18)                                                                        
    at Object.gotAccum (E:\Hexo\node_modules\bluebird\js\release\reduce.js:155:25)                                                                        
    at Object.tryCatcher (E:\Hexo\node_modules\bluebird\js\release\util.js:16:23)                                                                         
    at Promise._settlePromiseFromHandler (E:\Hexo\node_modules\bluebird\js\release\promise.js:547:31)                                                     
    at Promise._settlePromise (E:\Hexo\node_modules\bluebird\js\release\promise.js:604:18)                                                                
    at Promise._settlePromise0 (E:\Hexo\node_modules\bluebird\js\release\promise.js:649:10)                                                               
    at Promise._settlePromises (E:\Hexo\node_modules\bluebird\js\release\promise.js:729:18)                                                               
    at _drainQueueStep (E:\Hexo\node_modules\bluebird\js\release\async.js:93:12)                                                                          
    at _drainQueue (E:\Hexo\node_modules\bluebird\js\release\async.js:86:9)  
    at Async._drainQueues (E:\Hexo\node_modules\bluebird\js\release\async.js:102:5)                                                                       
    at Immediate.Async.drainQueues [as _onImmediate] (E:\Hexo\node_modules\bluebird\js\release\async.js:15:14)                                            
    at processImmediate (internal/timers.js:456:21)      

错误截图: 1

安装截图: 2

重现行为的步骤

  1. 安装Hexo Next主题
  2. 安装插件hexo-enchancer
  3. 执行hexo clean && hexo g && hexo s语句

环境信息

Node.js和NPM信息

v12.18.2
6.14.5

软件包依赖项信息

hexo-site@0.0.0 E:\Hexo
+-- hexo@4.2.1
+-- hexo-enhancer@1.0.8
+-- hexo-filter-emoji@2.2.1
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-category@1.0.0
+-- hexo-generator-feed@2.2.0
+-- hexo-generator-index@1.0.0
+-- hexo-generator-searchdb@1.3.0
+-- hexo-generator-tag@1.0.0
+-- hexo-helper-live2d@3.1.1
+-- hexo-next-fireworks@1.0.0 (github:next-theme/hexo-next-fireworks#1392a15ad2abebd7f4982f97367524dda3c2fc63)
+-- hexo-next-minivaline@2.0.0
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-marked@2.0.0
+-- hexo-renderer-stylus@1.1.0
+-- hexo-server@1.0.0
+-- hexo-symbols-count-time@0.7.1
`-- live2d-widget-model-hijiki@1.0.5

补充说明:

插件hexo-enchancer与Next 7.x版本兼容,与Next 8.x版本不兼容

suyin-long commented 3 years ago

经过我仔细的研究,发现是因为\Hexo\node_modules\hexo-enhancer\index.js文件中的一段代码导致的,将其注释掉即可! 该段代码如下所示:

if (src && src.indexOf('$') >= 0) {
    data.mathjax = true
}

现在已经解决该问题!

suyin-long commented 3 years ago

我又发现个问题,hexo-enchancer@1.0.8版本的分类没有正确的按照目录层级进行分类; 而hexo-enchancer@1.0.7版本则没有这个问题,并且该版本还没有与Next 8.x不兼容的问题!

sisyphsu commented 3 years ago

谢谢你的反馈,近期忙于工作没有关注这个项目,非常抱歉。

你可以暂时先使用1.0.7版本,1.0.8版本是几个月前针对其他人的需求增加的功能,实现方案可能过于草率,我需要再仔细检查一下。

sisyphsu commented 3 years ago

你可以试下1.0.9版本,以上说的问题应该已经修复了。

suyin-long commented 3 years ago

你可以试下1.0.9版本,以上说的问题应该已经修复了。

我尝试了一下1.0.9版本,兼容问题解决了。但是分类没有正确的按照目录层级进行分类这个问题依旧存在,所以我退回到了1.0.7版本。

qiaogaojian commented 3 years ago

你可以试下1.0.9版本,以上说的问题应该已经修复了。

我尝试了一下1.0.9版本,兼容问题解决了。但是分类没有正确的按照目录层级进行分类这个问题依旧存在,所以我退回到了1.0.7版本。

感谢,我也遇到层级错误的问题了,回退到1.0.7之后解决了