opened
seaoak
username_0
$ (hexo clean --debug && hexo generate --debug) >z 2>&1
$ echo $?
0
$ ls public/
css/  fancybox/  js/
$
```

The log file "z" contains an error message as follows:

```
16:08:22.000 ERROR Process failed: _posts/hello-world.md
TypeError: this.relative_url is not a function
    at Hexo.urlForHelper (/home/foobar/blog/node_modules/hexo/lib/plugins/helper/url_for.js:28:17)
    at Model._Document.Document.<anonymous> (/home/foobar/blog/node_modules/hexo/lib/models/post.js:60:31)
    at Model._Document.Document.permalink (/home/foobar/blog/node_modules/warehouse/lib/types/virtual.js:70:22)
    at Model._Document.Document.Document.toObject (/home/foobar/blog/node_modules/warehouse/lib/document.js:79:42)
    at Database._Model.Model.Model._insertOne (/home/foobar/blog/node_modules/warehouse/lib/model.js:189:21)
    at /home/foobar/blog/node_modules/warehouse/lib/model.js:214:17
    at tryCatcher (/home/foobar/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /home/foobar/blog/node_modules/bluebird/js/release/using.js:185:26
    at tryCatcher (/home/foobar/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/home/foobar/blog/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/home/foobar/blog/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/foobar/blog/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/home/foobar/blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/foobar/blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/foobar/blog/node_modules/bluebird/js/release/async.js:17:14)
```

I read the history of `lib/models/post.js`, and I found the code was replaced many times:     
https://github.com/hexojs/hexo/commits/master/lib/models/post.js

I think we need to discuss this code.    
(and make enough test cases)

And also `hexo` command *should never* finish normally when a fatal error occurs.
"TypeError: this.relative_url is not a function" occurs when "relative_link: true"
issue
created
yubinbai
username_1
same stack trace for me
comment
created
NoahDragon
username_2
Reference to an closed post. #1680
comment
created
Digi59404
username_3
👍  I also am having this same issue. I updated hexo-renderer-markup to 0.3.0 the latest. This is supposed to have the patched code in #1680. However the issue still exists.
comment
created
NoahDragon
username_2
@username_3 have update Hexo to the latest?
comment
created
Digi59404
username_3
@username_2 Yes, I was at 3.3.5 - I had to downgrade to 3.3.0 in order for it to work.
comment
created
NoahDragon
username_2
@username_3 looks like some fix in between the 3.3.0 and 3.3.5 cause this issue.
comment
created
NoahDragon
username_2
@username_0 Could you please review the fix https://github.com/hexojs/hexo/pull/2656 ?
comment
closed
seaoak
username_0
issue