Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'replace' of null #2006

Closed
JackGuoFranklin opened this issue Jun 15, 2016 · 8 comments
Closed

Cannot read property 'replace' of null #2006

JackGuoFranklin opened this issue Jun 15, 2016 · 8 comments

Comments

@JackGuoFranklin
Copy link

执行 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

@leesei
Copy link
Member

leesei commented Jun 30, 2016

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

@ulisesantana
Copy link

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)

@simazhao
Copy link

simazhao commented Mar 2, 2017

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

@moqu79
Copy link

moqu79 commented Mar 8, 2017

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

@hezhii
Copy link

hezhii commented Aug 2, 2017

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

@hello-java-maker
Copy link

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

@Q10Viking
Copy link

Q10Viking commented Dec 2, 2018

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: /

@ghost
Copy link

ghost commented Jan 27, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants