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

Hexo 3.1.1 generate Error: expected end of comment, got end of file #1343

Closed
howiefh opened this issue Jun 21, 2015 · 6 comments
Closed

Hexo 3.1.1 generate Error: expected end of comment, got end of file #1343

howiefh opened this issue Jun 21, 2015 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@howiefh
Copy link

howiefh commented Jun 21, 2015

hexo从2.8.3升级到3.1.1之后,使用命令hexo g时报错:

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: expected end of comment, got end of file
    at Tokenizer.nextToken (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/lexer.js:282:23)
    at Object.extend.nextToken (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/parser.js:32:27)
    at Object.extend.peekToken (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/parser.js:44:43)
    at Object.extend.parseNodes (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/parser.js:1124:38)
    at Object.extend.parseAsRoot (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/parser.js:1177:42)
    at Object.module.exports.parse (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/parser.js:1199:18)
    at Object.module.exports.compile (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/compiler.js:1118:48)
    at Obj.extend._compile (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:444:35)
    at Obj.extend.compile (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:433:18)
    at null.<anonymous> (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:378:22)
    at Object.exports.withPrettyErrors (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/lib.js:24:16)
    at Obj.extend.render (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:374:20)
    at Obj.extend.renderString (/home/fenghao/blog/node_modules/hexo/node_modules/nunjucks/src/environment.js:261:21)
    at /home/fenghao/blog/node_modules/hexo/lib/extend/tag.js:56:9
    at tryCatcher (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._resolveFromResolver (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:427:31)
    at new Promise (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:53:37)
    at Tag.render (/home/fenghao/blog/node_modules/hexo/lib/extend/tag.js:55:10)
    at Object.tagFilter [as onRenderEnd] (/home/fenghao/blog/node_modules/hexo/lib/hexo/post.js:253:16)
    at Promise.then.then.then.output (/home/fenghao/blog/node_modules/hexo/lib/hexo/render.js:55:19)
    at tryCatcher (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Promise._settlePromises (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
    at Async._drainQueue (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:182:16)
    at Async._drainQueues (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:192:10)
    at Async.drainQueues (/home/fenghao/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:419:13)

试着找了一下原因,发现只要将一个markdown文件中的内容“Error ${#v0} ${#v1}”去掉以后就好了,好像是#的问题。之前的版本2.8.3没有出现这个问题。

@tommy351 tommy351 added the bug Something isn't working label Jun 22, 2015
@tommy351 tommy351 added this to the 3.2 milestone Jun 22, 2015
@cedar-renjun
Copy link

同样遇到了这个问题,改的哪个文件?

@howiefh
Copy link
Author

howiefh commented Oct 11, 2015

我的是一个文件中有Error ${#v0} ${#v1}导致的

@ruiaylin
Copy link

我也遇到了 这个问题
没有找到原因

@leesei
Copy link
Member

leesei commented Feb 23, 2016

Unexpected end of comment, got end of file 通常都是Nunjuck parse error
要找出用 {% raw %}/{% endraw %} block

參考#1771 (comment)

@leesei leesei closed this as completed Feb 23, 2016
@YuanZhou314
Copy link

确实是 # 的问题,删掉或者用别的替换就好了(Latex公式无法替换,哭了,)

@stevenjoezhang
Copy link
Member

可以设置 disableNunjucks:#4518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants