Hexo: Cannot read property 'replace' of null

Created on 15 Jun 2016  ·  8Comments  ·  Source: hexojs/hexo

执行 hexo g 后
FATAL Cannot read property 'replace' of null
TypeError: Cannot read property 'replace' of null
at /Users/guojunbing23/gitresouce/hexo/node_modules/hexo/lib/hexo/load_config.js:35:28
at tryCatcher (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/promise.js:502:31)
at Promise._settlePromise (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/promise.js:559:18)
at Promise._settlePromise0 (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10)
at Promise._settlePromises (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/promise.js:683:18)
at Async._drainQueue (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/Users/guojunbing23/gitresouce/hexo/node_modules/hexo/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues as _onImmediate
at processImmediate as _immediateCallback

Most helpful comment

请不要把 url: http://yoursite.com/ 中url:后面的部分删掉。

All 8 comments

Do refer to Hexo/plugin doc for properly configuring Hexo/your plugin
Also validate YAML with Online YAML Parser

I have exactly the same issue, how do you fixed @JackGuoFranklin?
Only happens when I am trying to generate. This the terminal output @leesei :

FATAL Cannot read property 'replace' of null
TypeError: Cannot read property 'replace' of null
    at /home/ulisesantana/apps/ulisesantana.github.io/node_modules/hexo/lib/hexo/load_config.js:34:30
    at tryCatcher (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/promise.js:504:31)
    at Promise._settlePromise (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/promise.js:561:18)
    at Promise._settlePromise0 (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/promise.js:606:10)
    at Promise._settlePromises (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/promise.js:685:18)
    at Async._drainQueue (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues (/home/ulisesantana/apps/ulisesantana.github.io/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:570:20)
    at tryOnImmediate (timers.js:550:5)
    at processImmediate [as _immediateCallback] (timers.js:529:5)

check the js code, find out your must config "url" property.

请不要把 url: http://yoursite.com/ 中url:后面的部分删掉。

Though you don't have a personal site, don't delete the configuration of "url" in "_config.yml".

when i write new blog ,it happen,how to fix?

when i write new blog ,it happen,how to fix?

please make sure the propertise of __config.xml is not empty:
Such as
Error

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url:  
root: 

change to

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url:  https://yourname.github.io/
root: /

make sure there is a slash after root:
I delete it accidentally
'''
root: /
'''

Was this page helpful?
0 / 5 - 0 ratings