hexo icon indicating copy to clipboard operation
hexo copied to clipboard

Cannot read property 'replace' of null

Open JackGuoFranklin opened this issue 10 years ago • 8 comments

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

JackGuoFranklin avatar Jun 15 '16 04:06 JackGuoFranklin

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

leesei avatar Jun 30 '16 15:06 leesei

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)

ulisesantana avatar Aug 17 '16 11:08 ulisesantana

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

zhaosima avatar Mar 02 '17 08:03 zhaosima

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

moqu79 avatar Mar 08 '17 12:03 moqu79

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

hezhii avatar Aug 02 '17 16:08 hezhii

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

hello-java-maker avatar Feb 10 '18 05:02 hello-java-maker

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

upangka avatar Dec 02 '18 03:12 upangka

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

ghost avatar Jan 27 '20 18:01 ghost