ppoffice / hexo-theme-icarus

A simple, delicate, and modern theme for the static site generator Hexo.
https://ppoffice.github.io/hexo-theme-icarus/
MIT License
6.28k stars 1.53k forks source link

YAML files in source folder make icarus crash #1249

Open noraj opened 6 months ago

noraj commented 6 months ago

Describe the bug

I have YAML files in source/, e.g., source/_authors/noraj.yml used for hexo-multiauthor

name: noraj (Alexandre ZANNI)
about: Cybersecurity engineer & Pentester

But when building (hexo g), I encounter those warnings:

Error: Inferno Error: normalization received an object that's not a valid VNode, you should stringify it first or fix createVNode flags. Object: "{"name":"noraj (Alexandre ZANNI)","about":"Cybersecurity engineer &
 Pentester","id":"noraj","source":"_authors/noraj.yml","_id":"clqbh783u02knuslk9yo4dxrj"}".                                                                                                                          
    at throwError (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:36:11)                                                                                                                      
    at throwIfObjectIsNotVNode (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:367:9)                                                                                                         
    at normalizeChildren (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:617:21)                                                                                                              
    at createVNode (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:398:9)                                                                                                                     
    at _class.render (/home/noraj/Dev/Rawsec-website/node_modules/hexo-theme-icarus/layout/common/article.jsx:58:41)                                                                                                 
    at renderVNodeToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:210:41)                                                                                                     
    at renderVNodeToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:337:37)                                                                                                     
    at renderVNodeToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:221:20)                                                                                                     
    at renderToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:356:12)                                                                                                          
    at /home/noraj/Dev/Rawsec-website/node_modules/hexo-renderer-inferno/lib/compile.js:37:20                                                                                                                        
    at _View._compiled (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/theme/view.ts:151:50)                                                                                                                   
    at _View.render (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/theme/view.ts:54:17)                                                                                                                       
    at /home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/hexo/index.ts:77:21                                                                                                                                      
    at tryCatcher (/home/noraj/Dev/Rawsec-website/node_modules/bluebird/js/release/util.js:16:23)                                                                                                                    
    at /home/noraj/Dev/Rawsec-website/node_modules/bluebird/js/release/method.js:15:34                                                                                                                               
    at RouteStream._read (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/hexo/router.ts:60:5)                                                                                                                  
    at RouteStream.Readable.read (node:internal/streams/readable:737:12)                                                                                                                                             
    at resume_ (node:internal/streams/readable:1255:12)                                                                                                                                                              
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

That becomes an error when serving (hexo s)

Unhandled rejection Error: Inferno Error: normalization received an object that's not a valid VNode, you should stringify it first or fix createVNode flags. Object: "{"name":"noraj (Alexandre ZANNI)","about":"Cybersecurity engineer & Pentester","id":"noraj","source":"_authors/noraj.yml","_id":"clqbh783u02knuslk9yo4dxrj"}".
    at throwError (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:36:11)
    at throwIfObjectIsNotVNode (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:367:9)
    at normalizeChildren (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:617:21)
    at createVNode (/home/noraj/Dev/Rawsec-website/node_modules/inferno/dist/index.cjs.js:398:9)
    at _class.render (/home/noraj/Dev/Rawsec-website/node_modules/hexo-theme-icarus/layout/common/article.jsx:58:41)
    at renderVNodeToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:210:41)
    at renderVNodeToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:221:20)
    at renderToString (/home/noraj/Dev/Rawsec-website/node_modules/inferno-server/dist/index.cjs.js:356:12)
    at /home/noraj/Dev/Rawsec-website/node_modules/hexo-renderer-inferno/lib/compile.js:37:20
    at _View._compiled (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/theme/view.ts:151:50)
    at _View.render (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/theme/view.ts:54:17)
    at /home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/hexo/index.ts:77:21
    at tryCatcher (/home/noraj/Dev/Rawsec-website/node_modules/bluebird/js/release/util.js:16:23)
    at /home/noraj/Dev/Rawsec-website/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/noraj/Dev/Rawsec-website/node_modules/hexo/lib/hexo/router.ts:60:5)
    at RouteStream.Readable.read (node:internal/streams/readable:737:12)
    at resume_ (node:internal/streams/readable:1255:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

System and Environment

To Reproduce

  1. cd into empty folder
  2. hexo init
  3. npm install -S hexo-theme-icarus hexo-renderer-inferno
  4. hexo config theme icarus
  5. Copy whatever YAML files in the source folder, e.g., cp _config.landscape.yml source/landscape.yml
  6. hexo g && hexo s

Note: With this minimal reproduction steps, I have a different error:

FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError: Cannot read properties of undefined (reading 'toString')
    at toString (/tmp/toto/node_modules/hexo/lib/hexo/render.ts:22:21)
    at /tmp/toto/node_modules/hexo/lib/hexo/render.ts:87:16
    at tryCatcher (/tmp/toto/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/tmp/toto/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/tmp/toto/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/tmp/toto/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/tmp/toto/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/tmp/toto/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/tmp/toto/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/tmp/toto/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/tmp/toto/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:478:21)

Note2: Copying noraj.yml instead generates no error and YAML files are converted to JSON instead.

Expected behavior

YAML files would be ignored by hexo-renderer-inferno.

Screenshots

N/A

Additional context

package.json ```json { "name": "hexo-site", "version": "0.0.0", "private": true, "hexo": { "version": "7.0.0" }, "dependencies": { "hexo": "7.0.0", "hexo-generator-archive": "2.0.0", "hexo-generator-category": "2.0.0", "hexo-generator-feed": "3.0.0", "hexo-generator-index": "3.0.0", "hexo-generator-json-content": "4.2.3", "hexo-generator-tag": "2.0.0", "hexo-i18n": "2.0.0", "hexo-multiauthor": "0.0.1", "hexo-pagination": "3.0.0", "hexo-renderer-ejs": "2.0.0", "hexo-renderer-inferno": "^0.1.3", "hexo-renderer-markdown-it": "7.1.0", "hexo-renderer-stylus": "3.0.0", "hexo-server": "3.0.0", "hexo-spoiler": "1.7.3", "hexo-tag-asciinema": "0.0.3", "hexo-tag-chart": "^1.0.8", "hexo-tag-embed": "^1.0.0", "hexo-theme-icarus": "^5.2.1" } } ```
ppoffice commented 6 months ago

Did you put it under your-blog/source/_authors or your-blog/themes/icarus/source/_authors?

noraj commented 6 months ago

Under your-blog/source/_authors

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

noraj commented 3 months ago

stale bots...