nihgwu / hexo-hey

an admin plugin for hexo
http://nihgwu.github.io/hexo-hey/
MIT License
208 stars 39 forks source link

TypeError: Cannot read property '_id' of undefined #13

Closed MrChu closed 8 years ago

MrChu commented 8 years ago

g:\Frontend Developer\Hexo\Blog\node_modules\hexo-hey\api.js:125 id: post._id, ^ TypeError: Cannot read property '_id' of undefined at g:\Frontend Developer\Hexo\Blog\node_modules\hexo-hey\api.js:125:21 at doNTCallback0 (node.js:428:9) at process._tickCallback (node.js:357:13)

nihgwu commented 8 years ago

如何重现?我感觉是post create失败了,是不时没有写入权限导致的 请提供一下系统环境信息

MrChu commented 8 years ago

post create成功了,但是提示文章更新失败,是不是中文的原因?提示完之后服务直接就停止了,重启之后文章列表可以看到新创建的文章。。。 Windows 7,Chrome浏览器

MrChu commented 8 years ago

还有一个问题,文章设置的中文标签和分类好像都没有保存下来,文章修改后的内容也没用保存

title: 北京地铁线路图 tags: [] categories: []

date: 2015-11-30 12:05:00

nihgwu commented 8 years ago

等这阵子忙完了好好改改。。感谢反馈

MrChu commented 8 years ago

辛苦了^_^

kuncevic commented 8 years ago

I am getting same issue on my Windows dev PC. It is happening when creating or updating the post.

INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
d:\Projects\hexoblog\node_modules\hexo-hey\api.js:125
            id: post._id,
                    ^

TypeError: Cannot read property '_id' of undefined
    at d:\Projects\hexoblog\node_modules\hexo-hey\api.js:125:21
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)

However I tested that on OS X and there is no such issue. I can easily update and create the posts there but on Windows the server just stops with the error above after I clicking update button

nihgwu commented 8 years ago

@riapp sorry for that, i will release a new version ASAP

ghost commented 8 years ago

遇到同样问题,建新文章一按发布,hexo就报错了,但是md文件生成成功。 环境是win7+firefox hexo 3.1.1 hexo-hey 0.3.1

INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
invalid "expiresInMinutes" option for string payload
jsonwebtoken: expiresInMinutes and expiresInSeconds is deprecated. (D:\Backup\MEGAsync\blog\node_modules\hexo-hey\api.js:39:45)
Use "expiresIn" expressed in seconds.
D:\Backup\MEGAsync\blog\node_modules\hexo-hey\api.js:125
            id: post._id,
                    ^

TypeError: Cannot read property '_id' of undefined
    at D:\Backup\MEGAsync\blog\node_modules\hexo-hey\api.js:125:21
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)