hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.28k stars 4.83k forks source link

Template render error: (unknown path) [Line 40, Column 59] #2761

Closed LiangRenDev closed 6 years ago

LiangRenDev commented 7 years ago

Environment Info

Node version(8.1.0):

Your site _config.yml (Optional):

Your theme _config.yml (Optional):

Hexo and Plugin version(3.3.9):

For BUG

  1. Error is as below PS C:\PrivateAppDev\Hexo\Hexo> hexo g --config source/_data/next.yml INFO Start processing FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html Template render error: (unknown path) [Line 40, Column 59] Error: Unable to call now, which is undefined or falsey at Object.exports.prettifyError (C:\PrivateAppDev\Hexo\Hexo\node_modules\nunjucks\src\lib.js:34:15) at C:\PrivateAppDev\Hexo\Hexo\node_modules\nunjucks\src\environment.js:486:31 at new_cls.root [as rootRenderFunc] (eval at _compile (C:\PrivateAppDev\Hexo\Hexo\node_modules\nunjucks\src\environment.js:565:24), :22:3) at new_cls.render (C:\PrivateAppDev\Hexo\Hexo\node_modules\nunjucks\src\environment.js:479:15) at new_cls.renderString (C:\PrivateAppDev\Hexo\Hexo\node_modules\nunjucks\src\environment.js:327:21) at C:\PrivateAppDev\Hexo\Hexo\node_modules\hexo\lib\extend\tag.js:66:9 at Promise._execute (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\debuggability.js:300:9) at Promise._resolveFromExecutor (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:483:18) at new Promise (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:79:10) at Tag.render (C:\PrivateAppDev\Hexo\Hexo\node_modules\hexo\lib\extend\tag.js:64:10) at Object.tagFilter [as onRenderEnd] (C:\PrivateAppDev\Hexo\Hexo\node_modules\hexo\lib\hexo\post.js:266:16) at C:\PrivateAppDev\Hexo\Hexo\node_modules\hexo\lib\hexo\render.js:65:19 at tryCatcher (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\promise.js:693:18) at Async._drainQueue (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\async.js:133:16) at Async._drainQueues (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\async.js:143:10) at Immediate.Async.drainQueues [as _onImmediate] (C:\PrivateAppDev\Hexo\Hexo\node_modules\bluebird\js\release\async.js:17:14) at runCallback (timers.js:800:20) at tryOnImmediate (timers.js:762:5) at processImmediate [as _immediateCallback] (timers.js:733:5)
  2. The way to reproduce Whenever I add below content into my post, the error message will show, and when I delete it and generate again, it will be OK, so I guess there are some bad character in it, but it shows correctly at github
'Option Description
repo GitHub/Bitbucket/Coding/GitLab repository URL
branch Branch name. The deployer will detect the branch automatically if you are using GitHub or GitCafe
message Customize commit message (Default to Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }})

Notice {{ now('YYYY-MM-DD HH:mm:ss') }} when you write it in _config.yml, should add quotation marks like "{{ now('YYYY-MM-DD HH:mm:ss') }}" otherwise a error will be invoked'

  1. Log with hexo --debug

For question

For feature request

tea3 commented 7 years ago

@LeonAppDev

Can not check the markdown file in question by the following method ?

  1. Add the following code to the theme's script path (e.g. hexo-theme-landscape/scripts/fancybox.js).
hexo.extend.filter.register('after_post_render', function(data){
  console.log("\u001b[32mFinish\u001b[0m :" + data.source);
  return data;
});

hexo.extend.filter.register('before_post_render', function(data){
  console.log("\u001b[35mRendering\u001b[0m :" + data.source);
  return data;
});
  1. run server
$ hexo clean
$ hexo s
  1. Check the article file that does not finished to render markdown.
$ hexo clean
$ hexo s
INFO  Start processing
Rendering :_posts/hello-world.md
Rendering :_posts/hello-world2.md
Rendering :_posts/hello-world3.md
Finish :_posts/hello-world2.md
Finish :_posts/hello-world3.md

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path) [Line xx, Column xx]
...

In the example above, you can see that there is a problem with _posts/hello-world.md. Please make sure markdown description is correct. If there is a description now , that may be a problem.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.