Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
suyin-long opened this issue May 16, 2020 · 6 comments
Open

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

suyin-long opened this issue May 16, 2020 · 6 comments

Comments

@suyin-long
Copy link

suyin-long commented May 16, 2020

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 suyin-long changed the title 安装最新版本的Hexo和Next v8.2后再安装你这个插件运行Hexo会报错! Next 8.x与插件hexo-enchancer不兼容 Jul 9, 2020
@suyin-long
Copy link
Author

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

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

现在已经解决该问题!

@suyin-long
Copy link
Author

suyin-long commented Jul 9, 2020

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

@sisyphsu
Copy link
Owner

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

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

sisyphsu added a commit that referenced this issue Jul 14, 2020
@sisyphsu
Copy link
Owner

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

@suyin-long
Copy link
Author

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

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

@qiaogaojian
Copy link

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants