Hexo: TypeError when running hexo server

Created on 4 Jan 2020  Β·  5Comments  Β·  Source: hexojs/hexo

Check List

Please check followings before submitting a new issue.

  • [x] I have already read Docs page & Troubleshooting page
  • [x] I have already searched existing issues and they are not help to me
  • [x] I examined error or warning messages and it's difficult to solve
  • [x] Using the latest version of Hexo (run hexo version to check)
  • [x] Node.js is higher than 8.6.0

Question

Full error message at the bottom. When running hexo server or hexo generate I'm getting the message TypeError: Cannot convert undefined or null to object. This was working on 4.0.0 but then I updated the package.json to 4.2.0 and it stopped. Reverte to 4.0.0, ran hexo clean, removed the node_modules folder and re-ran yarn install. The error persists after those steps.

Environment & Settings

Node.js & npm version

node v13.5.0
npm 6.13.4
yarn 1.21.1

Your site _config.yml (Optional)

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Chainsaw Rendezvous
subtitle:
description: "Weekend long festival in Ridgway, PA showcasing the art of Chainsaw Carving"
author: Appalachian Arts Studio
language: en
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://chainsawrendezvous.org
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: chainsaw

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type:

# Aliases
## Docs: https://github.com/hexojs/hexo-generator-alias
alias:
  "schedule/": "2020/schedule"
  "map/": "2020/map"
  "carvers/": "2020/carvers"
  "carver-info/": "2020/carver-info"
  "vendor-info/": "2020/vendor-info"
  "vendors/": "2020/vendor-info"
  "sponsors/": "2020/sponsor-info"
  "media/": "2020/media-info"
  "entertainment/": "2020/entertainment"

Hexo and Plugin version(npm ls --depth 0)

[email protected] /Users/isaac/Development/chainsaw-rendezvous-hexo
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected] extraneous
└── [email protected]

npm ERR! extraneous: [email protected] /Users/isaac/Development/chainsaw-rendezvous-hexo/node_modules/node-pre-gyp

Your package.json package.json

{
  "name": "rendezvous-hexo",
  "version": "1.0.0",
  "private": true,
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "braces": "^3.0.2",
    "hexo": "^4.0.0",
    "hexo-generator-alias": "git+https://github.com/hexojs/hexo-generator-alias.git",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-server": "^1.0.0",
    "save": "^2.4.0"
  },
  "devDependencies": {
    "hexo-browsersync": "^0.3.0"
  }
}

Others

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at getKeys (~/site/node_modules/deepmerge/dist/cjs.js:61:16)
    at mergeObject (~/site/node_modules/deepmerge/dist/cjs.js:86:2)
    at deepmerge (~/site/node_modules/deepmerge/dist/cjs.js:117:10)
    at deepMerge (~/site/node_modules/hexo-util/lib/deep_merge.js:22:10)
    at new Locals (~/site/node_modules/hexo/lib/hexo/index.js:368:22)
    at ~/site/node_modules/hexo/lib/hexo/index.js:417:49
    at tryCatcher (~/site/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (~/site/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (~/site/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (~/site/node_modules/bluebird/js/release/promise_array.js:79:10)
    at Promise._settlePromise (~/site/node_modules/bluebird/js/release/promise.js:601:21)
    at Promise._settlePromise0 (~/site/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (~/site/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (~/site/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (~/site/node_modules/bluebird/js/release/promise.js:466:57)
    at ReductionPromiseArray._resolve (~/site/node_modules/bluebird/js/release/reduce.js:60:19)
    at Promise.completed [as _fulfillmentHandler0] (~/site/node_modules/bluebird/js/release/reduce.js:133:15)
    at Promise._settlePromise (~/site/node_modules/bluebird/js/release/promise.js:601:21)
    at Promise._settlePromise0 (~/site/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (~/site/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (~/site/node_modules/bluebird/js/release/async.js:93:12)
bug question

Most helpful comment

In my original issue post, I did not include my theme’s _config.yml file because it was empty. However that seems to be the issue. With the added ability to merge the config files there appears to need to be something in the file or it returns the error above.

All 5 comments

In my original issue post, I did not include my theme’s _config.yml file because it was empty. However that seems to be the issue. With the added ability to merge the config files there appears to need to be something in the file or it returns the error above.

I will try to include the fix in #4120

I had the same error and issue. Added a nonsense setting to the theme’s _config.yml file (it was empty) and the error went away.

Was this page helpful?
0 / 5 - 0 ratings