tea3 / hexo-related-popular-posts

A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts.
MIT License
109 stars 15 forks source link

If you use hexo5.0 and use the related Popular Posts plug-in, you may cause errors. #26

Closed aixiu closed 4 years ago

aixiu commented 4 years ago

I encountered some problems when using hexo-related-popular-posts:

Steps to reproduce the behavior

hexo clean
hexo g
FATAL {
  err: TypeError: Cannot read property 'length' of undefined
      at module.exports (E:\My_blog\node_modules\hexo-related-popular-posts\lib\cache.js:26:89)
      at Hexo.<anonymous> (E:\My_blog\node_modules\hexo-related-popular-posts\index.js:171:34)
      at Hexo.tryCatcher (E:\My_blog\node_modules\bluebird\js\release\util.js:16:23)
      at Hexo.<anonymous> (E:\My_blog\node_modules\bluebird\js\release\method.js:15:34)
      at E:\My_blog\node_modules\hexo\lib\extend\filter.js:67:52
      at tryCatcher (E:\My_blog\node_modules\bluebird\js\release\util.js:16:23)
      at Object.gotValue (E:\My_blog\node_modules\bluebird\js\release\reduce.js:166:18)
      at Object.gotAccum (E:\My_blog\node_modules\bluebird\js\release\reduce.js:155:25)
      at Object.tryCatcher (E:\My_blog\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (E:\My_blog\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (E:\My_blog\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromiseCtx (E:\My_blog\node_modules\bluebird\js\release\promise.js:641:10)
      at _drainQueueStep (E:\My_blog\node_modules\bluebird\js\release\async.js:97:12)
      at _drainQueue (E:\My_blog\node_modules\bluebird\js\release\async.js:86:9)
      at Async._drainQueues (E:\My_blog\node_modules\bluebird\js\release\async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (E:\My_blog\node_modules\bluebird\js\release\async.js:15:14)
      at processImmediate (internal/timers.js:456:21)
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

Node.js and NPM Information

$ node -v && npm -v
v12.16.1
6.13.4
$ npm ls --depth 0
hexo-site@0.0.0 E:\My_blog
+-- hexo@5.0.0
+-- hexo-abbrlink@2.2.1
+-- hexo-baidu-url-submit@0.0.6
+-- hexo-deployer-git@2.1.0
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-baidu-sitemap@0.1.9
+-- hexo-generator-category@1.0.0
+-- hexo-generator-feed@2.2.0
+-- hexo-generator-index@1.0.0
+-- hexo-generator-searchdb@1.3.2
+-- hexo-generator-sitemap@2.0.0
+-- hexo-generator-tag@1.0.0
+-- hexo-next-tag@0.3.0 (github:theme-next/hexo-next-tag#095ca82d63db8e6e5231fa9a811d3d68f3d8cc88)
+-- hexo-next-utteranc@1.0.0 (github:theme-next/hexo-next-utteranc#f592272a73cb47923f25443709786942f0398a69)
+-- hexo-related-popular-posts@4.0.0
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-marked@3.0.0
+-- hexo-renderer-stylus@1.1.0
+-- hexo-server@1.0.0
+-- hexo-util@2.2.0
+-- hexo-word-counter@0.0.2
`-- shelljs@0.8.4

所有的插件版本,hexo-related-popular-posts@4.0.0,主题配置文件。

# Related popular posts 相关热门贴子
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
related_posts:
  enable: true
  title: # Custom header, leave empty to use the default one
  display_in_home: false
  params:
    maxCount: 5
    #PPMixingRate: 0.0
    #isDate: false
    #isImage: false
    #isExcerpt: fals

https://github.com/next-theme/hexo-theme-next/issues/66

sxyugao commented 4 years ago

I have the same problem