hexojs / hexo-generator-feed

Feed generator for Hexo.

Home Page:http://hexo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a plan to support 3.2.2?

Jacksgong opened this issue · comments

Thanks very much, this is a very nice plugin for hexo.

But when I upgrade the hexo from 3.1.x to 3.2.2, this plugin crashes when I try to generate the website.


My _config.yml:

...yml
plugins:
- hexo-generator-feed
...
feed:
    type: atom
    path:atom.xml
    limit: 20
...

Version:

hexo-generator-feed@1.2.0
hexo: 3.2.2
hexo-cli: 1.0.2
os: Darwin 16.0.0 darwin x64
http_parser: 2.6.0
node: 5.4.0
v8: 4.6.85.31
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 47
openssl: 1.0.2e
{ 'hexo-site': '0.0.0',
  npm: '3.10.7',
  ares: '1.10.1-DEV',
  http_parser: '2.6.0',
  icu: '56.1',
  modules: '47',
  node: '5.4.0',
  openssl: '1.0.2e',
  uv: '1.8.0',
  v8: '4.6.85.31',
  zlib: '1.2.8' }

Error when executor: hexo g with hexo-generator-feed@1.2.0:

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 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
    at Object.exports.prettifyError (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/lib.js:34:15)
    at /Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:485:31
    at root [as rootRenderFunc] (eval at <anonymous> (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:564:24), <anonymous>:161:3)
    at Obj.extend.render (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:478:15)
    at Hexo.module.exports (/Users/Jacksgong/code/github/blog/node_modules/hexo-generator-feed/lib/generator.js:28:22)
    at Hexo.tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/Jacksgong/code/github/blog/node_modules/hexo/lib/hexo/index.js:337:24
    at tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:57:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise_array.js:77:10)
    at new MappingPromiseArray (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:25:10)
    at map (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:152:12)
    at Function.Promise.map (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:160:12)
    at /Users/Jacksgong/code/github/blog/node_modules/hexo/lib/hexo/index.js:334:20
    at tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:683:18)
    at Async._drainQueue (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/async.js:138:16)
FATAL (unknown path) [Line 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
Template render error: (unknown path) [Line 7, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
    at Object.exports.prettifyError (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/lib.js:34:15)
    at /Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:485:31
    at root [as rootRenderFunc] (eval at <anonymous> (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:564:24), <anonymous>:161:3)
    at Obj.extend.render (/Users/Jacksgong/code/github/blog/node_modules/nunjucks/src/environment.js:478:15)
    at Hexo.module.exports (/Users/Jacksgong/code/github/blog/node_modules/hexo-generator-feed/lib/generator.js:28:22)
    at Hexo.tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/Jacksgong/code/github/blog/node_modules/hexo/lib/hexo/index.js:337:24
    at tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:57:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise_array.js:77:10)
    at new MappingPromiseArray (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:25:10)
    at map (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:152:12)
    at Function.Promise.map (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/map.js:160:12)
    at /Users/Jacksgong/code/github/blog/node_modules/hexo/lib/hexo/index.js:334:20
    at tryCatcher (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/promise.js:683:18)
    at Async._drainQueue (/Users/Jacksgong/code/github/blog/node_modules/bluebird/js/release/async.js:138:16)

I got the same error, too.
hexo-generator-feed@1.2.0
hexo: 3.2.2
FATAL (unknown path) [Line 7, Column 23] Error: Unable to call the return value of (posts["first"])["updated"]["toISOString"], which is undefined or falsey

I just comment this block

#plugins:
#- hexo-generator-feed

#Feed Atom
feed:
  type: atom
  path: atom.xml
  limit: 20

and i reinstall this plugin, hexo generator-feed plugin version - "hexo-generator-feed": "^1.2.0",

btw, my hexo version

$ hexo --version
hexo: 3.2.2
hexo-cli: 1.0.2
os: Windows_NT 6.1.7601 win32 x64
http_parser: 2.5.2
node: 4.4.7
v8: 4.5.103.36
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 46
openssl: 1.0.2h

It's work now~

I didn't have a "plugins" key in my document, so I was unable to comment it. This is still a problem for me.

I don't have the plugins in my config file too, but mine works well.

我把

plugins:
- hexo-generator-feed

注释掉就ok了

commented

plugins:
- hexo-generator-feed

改成

plugins:
  hexo-generator-feed

就行了,把短横线去掉

hexo: 3.3.8
hexo-cli: 1.0.2
os: Darwin 16.7.0 darwin x64
http_parser: 2.7.0
node: 6.11.1
v8: 5.1.281.103
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2k

is down

commented

+1

Template render error: (unknown path) [Line 8, Column 23]
  Error: Unable to call `the return value of (posts["first"])["updated"]["toISOString"]`, which is undefined or falsey
"hexo": "^3.3.9"
"hexo-generator-feed": "^1.2.0"

@printempw

plugins: 
  hexo-generator-feed
  hexo-generator-sitemap

This will work for this env:

"hexo": "^3.3.9"
"hexo-generator-feed": "^1.2.0"

I confirm that the plugin works for Hexo 3.3.9. It is only necessary to put the feed: properties in the top-level _config.yml file. See Wingnut Feature Activation - RSS Feed for demonstration.

我确认该插件适用于Hexo 3.3.9。 只需要将feed:属性放在顶层_config.yml文件中。 请参阅
[Wingnut Feature Activation - RSS Feed](http://orcmid.com/BlunderDome/wingnut/2017/12/15/feed/)
进行演示。

Also, nunjucks seem to only support node > 6, and you seem to have node 5. You should update to at least 8 (current LTS)

Template render error: (unknown path) [Line 8, Column 23]
Error: Unable to call the return value of (posts["first"])["updated"]["toISOString"], which is undefined or falsey
Thanks very much, this is a very nice plugin for hexo.
I got the same error, too. Because my _post directory is empty.
so something in a {{ posts.first().updated.toISOString() }} call doesn't return correctly.
and it works when i add some post in _post directory .

Please use latest version of Hexo 3, though we highly recommend to upgrade to Hexo 4.

#43 (comment) has been fixed in #107.