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 14 forks source link

Unhandled rejection TypeError [ERR_INVALID_ARG_TYPE] #24

Closed makisevon closed 4 years ago

makisevon commented 4 years ago

Node version: v12.8.1 theme: Next

related_posts:
  enable: true
  title: Related
  display_in_home: false
  params:
    maxCount: 3

Plugin version

+-- ajv@5.5.2
+-- babel-eslint@8.2.6
+-- boom@7.3.0
+-- cryptiles@4.1.3
+-- eslint@4.19.1
+-- hawk@7.0.10
+-- hexo@3.9.0
+-- hexo-baidu-url-submit@0.0.6
+-- hexo-deployer-git@1.0.0
+-- hexo-generator-archive@0.1.5
+-- hexo-generator-baidu-sitemap@0.1.6
+-- hexo-generator-category@0.1.3
+-- hexo-generator-feed@1.2.2
+-- hexo-generator-index-pin-top@0.2.2
+-- hexo-generator-search@2.4.0
+-- hexo-generator-sitemap@2.0.0
+-- hexo-generator-tag@0.2.0
+-- hexo-helper-live2d@3.1.1
+-- hexo-inject@1.0.0
+-- hexo-related-popular-posts@4.0.0
+-- hexo-renderer-ejs@0.3.1
+-- hexo-renderer-markdown-it-plus@1.0.4
+-- hexo-renderer-stylus@0.3.3
+-- hexo-server@0.3.3
+-- hexo-tag-aplayer@3.0.4
+-- hoek@6.1.3
+-- live2d-widget-model-shizuku@1.0.5
+-- node-uuid@1.4.8
+-- plugin@0.3.3
+-- request@2.88.2
`-- sntp@3.0.2

It‘s ok to run command hexo clean hexo g hexo s. But when I visit the page with related-tag-posts, it will cause an error.

Unhandled rejection TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at validateString (internal/validators.js:112:11)
    at Object.join (path.js:375:7)
    at getElm (F:\hexo\node_modules\hexo-related-popular-posts\lib\list-json.js:371:28)
    at Object.module.exports.getList (F:\hexo\node_modules\hexo-related-popular-posts\lib\list-json.js:383:23)
    at module.exports (F:\hexo\node_modules\hexo-related-popular-posts\lib\helper-json.js:3:19)
    at Object.<anonymous> (F:\hexo\node_modules\hexo-related-popular-posts\index.js:177:40)
    at Object.eval [as tpl] (eval at precompile (F:\hexo\node_modules\swig-templates\lib\swig.js:537:13), <anonymous>:5:173)
    at compiled (F:\hexo\node_modules\swig-templates\lib\swig.js:664:18)
    at Object.eval [as tpl] (eval at precompile (F:\hexo\node_modules\swig-templates\lib\swig.js:537:13), <anonymous>:336:136)
    at compiled (F:\hexo\node_modules\swig-templates\lib\swig.js:664:18)
    at Theme._View.View._compiledSync (F:\hexo\node_modules\hexo\lib\theme\view.js:119:22)
    at Theme._View.View.View.renderSync (F:\hexo\node_modules\hexo\lib\theme\view.js:48:23)
    at Object.partial (F:\hexo\node_modules\hexo\lib\plugins\helper\partial.js:34:15)
    at Object.eval [as tpl] (eval at precompile (F:\hexo\node_modules\swig-templates\lib\swig.js:537:13), <anonymous>:142:119)
    at compiled (F:\hexo\node_modules\swig-templates\lib\swig.js:664:18)
    at Theme._View.View._compiled (F:\hexo\node_modules\hexo\lib\theme\view.js:123:48)
    at Theme._View.View.View.render (F:\hexo\node_modules\hexo\lib\theme\view.js:29:15)
    at F:\hexo\node_modules\hexo\lib\hexo\index.js:349:21
    at tryCatcher (F:\hexo\node_modules\bluebird\js\release\util.js:16:23)
    at F:\hexo\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (F:\hexo\node_modules\hexo\lib\hexo\router.js:123:3)
    at RouteStream.Readable.read (_stream_readable.js:481:10)
    at resume_ (_stream_readable.js:960:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

It just happens sometimes QAQ

jiyiren commented 4 years ago

+1

ivansf commented 4 years ago

+1

makisevon commented 4 years ago

Try to update the Next to the latest version.