ppoffice / hexo-theme-hueman

A redesign of Alx's wordpress theme Hueman, ported to Hexo.
http://ppoffice.github.io/hexo-theme-hueman/
GNU General Public License v2.0
1.17k stars 336 forks source link

Unhandled rejection TypeError [ERR_INVALID_ARG_TYPE] Problem (Mac) #236

Closed jeongwookie closed 5 years ago

jeongwookie commented 5 years ago

Hey guys. I recently set up my Windows desktop and sucessfully upload the post. But in my laptop, Macbook, something gets wrong. I found that when I made a "new post" and get new-post.md file, it didn't convert it to .html (in deploy_git folder). I found just empty .html file. (did hexo g --d) What should I do? When I tried another new post in my desktop (Windows), it worked well... Below is the error messege that I got when I did "hexo generete", open the "hexo server", and connected into local server.

Unhandled rejection TypeError [ERR_INVALID_ARG_TYPE]: /Users/sandfox/Dropbox/myBlog/themes/hueman/layout/layout.ejs:1

1| <%- partial('common/head') %> 2| 3|

4| <%- partial('common/header', null, {cache: !config.relative_link}) %>

/Users/sandfox/Dropbox/myBlog/themes/hueman/layout/common/head.ejs:35 33| 34| <% } %>

35| <%- open_graph({ 36| image: thumbnail(page), 37| fb_app_id: theme.miscellaneous.open_graph.fb_app_id, 38| fb_admins: theme.miscellaneous.open_graph.fb_admins,

The "url" argument must be of type string. Received type null at Url.parse (url.js:106:11) at Object.urlParse [as parse] (url.js:100:13) at images.map.path (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:102:16) at Array.map () at Object.openGraphHelper (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:101:19) at Object.wrapper [as open_graph] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19) at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), :63:17) at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17) at Theme._View.View._compiledSync.locals [as _compiledSync] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:120:22) at Theme._View.View.View.renderSync (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:48:23) at Object.partial (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/partial.js:39:15) at Object.wrapper [as partial] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19) at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), :9:17) at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17) at Theme._View.View._compiled.locals [as _compiled] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:124:48) at Theme._View.View.View.render (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:29:15) at _compiled.then.result (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:40:23) at tryCatcher (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:694:18)

ppoffice commented 5 years ago

@jeongwookie I think you missed out something in the _config.yml file. Could you please compare yours to the _config.yml.example and post it here?

jeongwookie commented 5 years ago

Thanks @ppoffice for your kind reply. my _config.yml is below. I can't find the difference.

# Menus
menu:
    Home: /
    # Delete this row if you don't want categories in your header nav bar
    Categories:
    About: https://about.me/jeongwook

# Customize
customize:
    logo:
        width: 200
        height: 80
        url: https://user-images.githubusercontent.com/25416425/45254988-0f7eec80-b3bc-11e8-8914-8f0d45a1505b.png
    theme_color: '#006bde'
    highlight: androidstudio
    sidebar: right # sidebar position, options: left, right
    thumbnail: true # enable posts thumbnail, options: true, false
    favicon: https://user-images.githubusercontent.com/25416425/45255002-3806e680-b3bc-11e8-8d51-5dde5f6c454d.png
    # path to favicon
    social_links: # for more icons, please see http://fontawesome.io/icons/#brand
        facebook: /
        google-plus: /
        github: https://github.com/jeongwookie
        weibo: /
        rss: /

# Widgets
widgets:
    - catalog
    - recent_posts
    - category
    - archive
    - tag
    - tagcloud
    - links

# Search
search:
    insight: true # you need to install `hexo-generator-json-content` before using Insight Search
    swiftype: # enter swiftype install key here
    baidu: false # you need to disable other search engines to use Baidu search, options: true, false

# Comment
comment:
    disqus: jeongwookie # enter disqus shortname here
    duoshuo: # enter duoshuo shortname here
    youyan: # enter youyan uid here
    facebook: true # enter true to enable
    isso: # options for isso. All fields below are OPTIONAL (except for site). See https://posativ.org/isso/docs/configuration/client/ for more information.
        on: # enter true to enable isso
        site: # enter the domain name of your own comment isso server, eg. comments.example.com
        lang: # two letter language code, eg. en
        reply-to-self: # true when your server spam guard has this value set
        require-author: # true when your server spam guard has this value set
        require-email: # true when your server spam guard has this value set
        max-comments-top: # number of top level comments to show, specify "inf" for all
        max-comments-nested: # number of nested comments to show.
        reveal-on-click: # number of comments to reveal when clicking "hidden" link
        avatar: # true|false, setting to enable avatar generation
        avatar-bg: # background color of avatar, i.e. "#f0f0f0"
        avatar-fg: # set pallet of foreground colors (up to 8) i.e. "#9abf88 #5698c4 #e279a3 #9163b6"
        vote: # true|false, setting to enable voting feature on client side.
        vote-levels: # levels to customize appearance of comments, eg. "[-5, 5, 15]" or "0,5,10"
    changyan:
        appId: # enter the changyan appId here
        appKey: # enter the changyan appKey here
        on: # enter true to enable
    valine: # Valine Comment System https://github.com/xCss/Valine
        on:  # enter true to enable valine
        appId:  # enter the leancloud application appId here
        appKey:  # enter the leancloud application appKey here
        notify: # enter true to enable <Mail notifier> https://github.com/xCss/Valine/wiki/Valine-%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E9%82%AE%E4%BB%B6%E6%8F%90%E9%86%92%E8%AE%BE%E7%BD%AE
        verify: # enter true to enable <Validation code>
        placeholder: Just Do It # enter the comment box placeholder
        avatar: identicon # (''/mm/identicon/monsterid/wavatar/retro/hide), more to see https://valine.js.org/avatar/
        avatar_cdn: https://gravatar.loli.net/avatar/ # avatar CDN address, default gravatar.loli.net
        pageSize: 10 # comments of one page

# Share
share: default # options: jiathis, bdshare, addtoany, default

# Plugins
plugins:
    lightgallery: true # options: true, false
    justifiedgallery: true # options: true, false
    google_analytics: # enter the tracking ID for your Google Analytics
    baidu_analytics: # enter Baidu Analytics hash key
    bing_site_verification: # enter Bing verification key here
    statcounter:
      sc_project: # enter statcounter project id
      sc_invisible: # enter 1 to make statcounter invisible
      sc_security: # enter security code
      public: # enter true if you want a link to your public stats. Must be configured on statcouter as well.
      on: # enter true to enable statcounter
    mathjax: false # options: true, false

# Miscellaneous
miscellaneous:
    open_graph: # see http://ogp.me
        fb_app_id:
        fb_admins:
        twitter_id:
        google_plus:
    links:
        Hexo: http://hexo.io
ppoffice commented 5 years ago

@jeongwookie

  1. Did you run hexo clean after changing your theme?
  2. What's the version of your hexo and its dependencies?
  3. When did the error occur? hexo generate or hexo serve? On which post? It will be great if you give me the source code of that post.
jeongwookie commented 5 years ago

@ppoffice 1. Yes, I did it but did not work.

2 my hexo version is in below.

hexo: 3.7.1
hexo-cli: 1.1.0
os: Darwin 17.4.0 darwin x64
http_parser: 2.7.0
node: 9.4.0
v8: 6.2.414.46-node.17
uv: 1.18.0
zlib: 1.2.11
ares: 1.13.0
modules: 59
nghttp2: 1.29.0
openssl: 1.0.2n
icu: 60.1
unicode: 10.0
cldr: 32.0
tz: 2017c

3. when I did "hexo generate", something like below:

ERROR /Users/sandfox/Dropbox/myBlog/themes/hueman/layout/layout.ejs:1
 >> 1| <%- partial('common/head') %>
    2| <body>
    3|     <div id="wrap">
    4|         <%- partial('common/header', null, {cache: !config.relative_link}) %>

/Users/sandfox/Dropbox/myBlog/themes/hueman/layout/common/head.ejs:35
    33|         <meta name="keywords" content="<%= keywords.join(',') %>" />
    34|     <% } %>
 >> 35|     <%- open_graph({
    36|         image:          thumbnail(page),
    37|         fb_app_id:      theme.miscellaneous.open_graph.fb_app_id,
    38|         fb_admins:      theme.miscellaneous.open_graph.fb_admins,

The "url" argument must be of type string. Received type null
TypeError [ERR_INVALID_ARG_TYPE]: /Users/sandfox/Dropbox/myBlog/themes/hueman/layout/layout.ejs:1
 >> 1| <%- partial('common/head') %>
    2| <body>
    3|     <div id="wrap">
    4|         <%- partial('common/header', null, {cache: !config.relative_link}) %>

/Users/sandfox/Dropbox/myBlog/themes/hueman/layout/common/head.ejs:35
    33|         <meta name="keywords" content="<%= keywords.join(',') %>" />
    34|     <% } %>
 >> 35|     <%- open_graph({
    36|         image:          thumbnail(page),
    37|         fb_app_id:      theme.miscellaneous.open_graph.fb_app_id,
    38|         fb_admins:      theme.miscellaneous.open_graph.fb_admins,

The "url" argument must be of type string. Received type null
    at Url.parse (url.js:106:11)
    at Object.urlParse [as parse] (url.js:100:13)
    at images.map.path (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:102:16)
    at Array.map (<anonymous>)
    at Object.openGraphHelper (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:101:19)
    at Object.wrapper [as open_graph] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19)
    at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:63:17)
    at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17)
    at Theme._View.View._compiledSync.locals [as _compiledSync] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:120:22)
    at Theme._View.View.View.renderSync (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:48:23)
    at Object.partial (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/partial.js:39:15)
    at Object.wrapper [as partial] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19)
    at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:9:17)
    at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17)
    at Theme._View.View._compiled.locals [as _compiled] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:124:48)
    at Theme._View.View.View.render (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:29:15)
    at _compiled.then.result (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:40:23)
    at tryCatcher (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:694:18)

3-1. when I did "hexo server" and connect into localhost:4000, it works. But, when i click the post that I made using Mac, error code appears like below:

Unhandled rejection TypeError [ERR_INVALID_ARG_TYPE]: /Users/sandfox/Dropbox/myBlog/themes/hueman/layout/layout.ejs:1
 >> 1| <%- partial('common/head') %>
    2| <body>
    3|     <div id="wrap">
    4|         <%- partial('common/header', null, {cache: !config.relative_link}) %>

/Users/sandfox/Dropbox/myBlog/themes/hueman/layout/common/head.ejs:35
    33|         <meta name="keywords" content="<%= keywords.join(',') %>" />
    34|     <% } %>
 >> 35|     <%- open_graph({
    36|         image:          thumbnail(page),
    37|         fb_app_id:      theme.miscellaneous.open_graph.fb_app_id,
    38|         fb_admins:      theme.miscellaneous.open_graph.fb_admins,

The "url" argument must be of type string. Received type null
    at Url.parse (url.js:106:11)
    at Object.urlParse [as parse] (url.js:100:13)
    at images.map.path (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:102:16)
    at Array.map (<anonymous>)
    at Object.openGraphHelper (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/open_graph.js:101:19)
    at Object.wrapper [as open_graph] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19)
    at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:63:17)
    at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17)
    at Theme._View.View._compiledSync.locals [as _compiledSync] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:120:22)
    at Theme._View.View.View.renderSync (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:48:23)
    at Object.partial (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/plugins/helper/partial.js:39:15)
    at Object.wrapper [as partial] (/Users/sandfox/Dropbox/myBlog/node_modules/lodash/lodash.js:4949:19)
    at eval (eval at compile (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:9:17)
    at returnedFn (/Users/sandfox/Dropbox/myBlog/node_modules/ejs/lib/ejs.js:653:17)
    at Theme._View.View._compiled.locals [as _compiled] (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:124:48)
    at Theme._View.View.View.render (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:29:15)
    at _compiled.then.result (/Users/sandfox/Dropbox/myBlog/node_modules/hexo/lib/theme/view.js:40:23)
    at tryCatcher (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/sandfox/Dropbox/myBlog/node_modules/bluebird/js/release/promise.js:694:18)

3-2. my source code of the post is in below: (it's .md file)

---
title: Python 여러가지
categories: 
  - Python2
tags: 
  - test-test
thumbnail:
  - null
description:
  - null
date: 2018-09-08 10:02:37
---

##흠 수업옴

*흠 테스트*

왜 안올라가는거죠? 이상하다...
아직도 안올라가는건가?

Didn't work?!

ppoffice commented 5 years ago

@jeongwookie If you want no thumbnail or description. simply delete that line in your post's front-matter. Do not use null because it may cause the Hexo to crash. Also, thumbnail and description are not of the array type.

You can do the following instead:

title: Python 여러가지
categories: 
  - Python2
tags: 
  - test-test
thumbnail:
description:
date: 2018-09-08 10:02:37

or

title: Python 여러가지
categories: 
  - Python2
tags: 
  - test-test
- thumbnail:
-   - null
- description:
-   - null
date: 2018-09-08 10:02:37
jeongwookie commented 5 years ago

@ppoffice Thank you so much! It works :)