jaredly / hexo-admin

An Admin Interface for Hexo
http://jaredly.github.io/hexo-admin/
1.77k stars 299 forks source link

A error is occurred, my draft has been lost! #111

Closed ghost closed 7 years ago

ghost commented 7 years ago
TypeError: next is not a function
    at /home/ivanilla/blog/node_modules/hexo-admin/api.js:213:25
    at /home/ivanilla/blog/node_modules/hexo-admin/api.js:91:7
    at call (/home/ivanilla/blog/node_modules/connect/index.js:239:7)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:183:5)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:161:14)
    at jsonParser (/home/ivanilla/blog/node_modules/body-parser/lib/types/json.js:103:7)
    at call (/home/ivanilla/blog/node_modules/connect/index.js:239:7)
    at next (/home/ivanilla/blog/node_modules/connect/index.js:183:5)
    at SendStream.error (/home/ivanilla/blog/node_modules/serve-static/index.js:121:7)
    at emitOne (events.js:77:13)
    at SendStream.emit (events.js:169:7)
    at SendStream.error (/home/ivanilla/blog/node_modules/send/index.js:275:17)
    at SendStream.onStatError (/home/ivanilla/blog/node_modules/send/index.js:392:12)
    at next (/home/ivanilla/blog/node_modules/send/index.js:683:16)
    at onstat (/home/ivanilla/blog/node_modules/send/index.js:672:14)
    at FSReqWrap.oncomplete (fs.js:82:15)
pirtleshell commented 7 years ago

It looks like hexo admin wasn't able to find the post's id, either a failure to parse the url properly or some other reason.

Did you restart your Hexo server (or run clean) without refreshing your editor? This could have changed all the post id's and caused the editor to not be working on the proper post. Or it could be a bug in how we're handling the urls to get the id.

Are you able to reproduce what happened? It'd be really helpful if you could tell us more specifically how this happened. Also, are you certain the post is not in one of your source directories?

Sorry this happened, we'd definitely like to get it resolved so it doesn't happen to anyone in the future!

jaredly commented 7 years ago

It shouldn't have lost the draft -- hexo-admin auto-saves, and there's nothing that would delete it. Is it not in the _drafts folder?

ghost commented 7 years ago

@PirtleShell @jaredly Yes, there's a corresponding file in _drafts folder. Maybe because of this error, some of the content was not saved/lost.

pirtleshell commented 7 years ago

I'm closing this because it sounds like you found the post. Please reopen if it happens to you again.

ghost commented 7 years ago

@PirtleShell The post/draft is exists, but some of the content was not saved/lost.

GeekaholicLin commented 7 years ago

I had the same problem.It says it saved,but when I close the server and open the hexo-admin plugin next day,some content of the draft was lost.For example,my lastest updated date was 3/9 22:23,however the file modified time in the OS showed 3/9 15:42.Actually, the content that I wrote did not save even though it said"saved".It seems that if the draft occurred an error like wrong front-matter(But I didn't modified it.I don't know why it has been changed),it would failed to save automatically.