alexbruno / hexo-generator-json-content

Hexo (https://hexo.io/) plugin to generate a JSON file for generic use or consumption with the contents of posts and pages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property keywords of undefined

Buzut opened this issue · comments

commented

Everything works fine but the keywords.

Hexo 3.8.0 and hexo-generator-json-content 4.1.0

Here's my config:

jsonContent:
  meta: false
  dafts: false
  language: french
  keywords: true
  dateFormat: undefined
  file: api.json
  pages:
    title: false
    slug: false
    date: false
    updated: false
    comments: false
    path: false
    link: false
    permalink: false
    excerpt: false
    keywords: false
    text: false
    raw: false
    content: false
    author: false
  posts:
    title: true
    slug: false
    date: false
    updated: false
    comments: false
    path: false
    link: false
    permalink: true
    excerpt: false
    keywords: true
    text: false
    raw: false
    content: false
    author: false
    categories: false
    tags: true

And the error:

> hexo server

INFO  Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'keywords' of undefined
    at getKeywords (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:92:19)
    at setContent (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:114:24)
    at names.reduce (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:142:38)
    at Array.reduce (<anonymous>)
    at reduceContent (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:142:16)
    at postsValid.map.post (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:186:49)
    at Model._Query.Query.Query.map (/Users/buzut/Cloud/Buzut/Code/node_modules/warehouse/lib/query.js:229:17)
    at Hexo.hexo.extend.generator.register.site (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo-generator-json-content/dist/main.js:186:37)
    at Hexo.tryCatcher (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/method.js:15:34)
    at Promise.map.key (/Users/buzut/Cloud/Buzut/Code/node_modules/hexo/lib/hexo/index.js:344:26)
    at tryCatcher (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/map.js:61:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/promise_array.js:114:31)
    at MappingPromiseArray.init (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/promise_array.js:78:10)
    at MappingPromiseArray._asyncInit (/Users/buzut/Cloud/Buzut/Code/node_modules/bluebird/js/release/map.js:30:10)

Thanks @Buzut ! I will fix it ASAP.

Solved in v4.1.1
👍