hexojs / hexo-generator-feed

Feed generator for Hexo.
http://hexo.io
MIT License
574 stars 105 forks source link

Is there a plan to support 3.2.2? #43

Closed Jacksgong closed 4 years ago

Jacksgong commented 8 years ago

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)
allen286 commented 8 years ago

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

itabas016 commented 7 years ago

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~

jaredfaris commented 7 years ago

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

NoahDragon commented 7 years ago

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

JoakimLiu commented 7 years ago

我把

plugins:
- hexo-generator-feed

注释掉就ok了

hippo-jessy commented 7 years ago

plugins:
- hexo-generator-feed

改成

plugins:
  hexo-generator-feed

就行了,把短横线去掉

1a57danc3 commented 7 years ago

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

prinsss commented 7 years ago

+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"
stuarthua commented 7 years ago

@printempw

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

This will work for this env:

"hexo": "^3.3.9"
"hexo-generator-feed": "^1.2.0"
orcmid commented 6 years ago

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/) 进行演示。

tomap commented 6 years ago

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

lixd commented 5 years ago

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 .

curbengh commented 4 years ago

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

https://github.com/hexojs/hexo-generator-feed/issues/43#issuecomment-450580614 has been fixed in https://github.com/hexojs/hexo-generator-feed/pull/107.