Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 在最新的Hexo版本中出现报错 #76

Closed
TNXG opened this issue Apr 2, 2023 · 1 comment
Closed

[Bug]: 在最新的Hexo版本中出现报错 #76

TNXG opened this issue Apr 2, 2023 · 1 comment
Assignees

Comments

@TNXG
Copy link

TNXG commented Apr 2, 2023

使用的 Hexo-Theme-Asycn 版本? | What version of Hexo-Theme-Asycn are you use?

2.0.5

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的浏览器? || What browse are you using?

Edge

使用的系統? || What operating system are you using?

Windows

问题描述 | Describe the bug

在最新的Hexo 7.0.0-rc1中,在渲染页面时出现如下报错

Unhandled rejection TypeError: C:\Users\tianx\Desktop\blog\themes\async\layout\index.ejs:1
 >> 1| <%- partial(theme.layout.main,  {
    2|     banner: partial(theme.layout.banner,  {
    3|         ...theme.banner.default,
    4|         bannerTitle: page.title,

C:\Users\tianx\Desktop\blog\themes\async\layout\_partial\page\index.ejs:4
    2| <% if(theme.categorie_card.enable) { %>
    3|     <div class="row hidden-sm">
 >> 4|         <%
    5|             let cards = []
    6|             if (Array.isArray(theme.categorie_card.list)) {
    7|                 theme.categorie_card.list.forEach(title => {

site.categories.data.sort is not a function
    at eval ("C:\\Users\\tianx\\Desktop\\blog\\themes\\async\\layout\\_partial\\page\\index.ejs":23:46)
    at index (C:\Users\tianx\Desktop\blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiledSync (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:122:32)
    at _View.renderSync (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:64:29)
    at Object.partial (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\plugins\helper\partial.js:27:17)
    at eval ("C:\\Users\\tianx\\Desktop\\blog\\themes\\async\\layout\\index.ejs":16:14)
    at index (C:\Users\tianx\Desktop\blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiled (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:125:67)
    at _View.render (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:50:21)
    at C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\hexo\index.js:58:29
    at tryCatcher (C:\Users\tianx\Desktop\blog\node_modules\bluebird\js\release\util.js:16:23)
    at C:\Users\tianx\Desktop\blog\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\hexo\router.js:43:9)
    at Readable.read (node:internal/streams/readable:496:12)
    at resume_ (node:internal/streams/readable:999:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Unhandled rejection TypeError: C:\Users\tianx\Desktop\blog\themes\async\layout\index.ejs:1
 >> 1| <%- partial(theme.layout.main,  {
    2|     banner: partial(theme.layout.banner,  {
    3|         ...theme.banner.default,
    4|         bannerTitle: page.title,

C:\Users\tianx\Desktop\blog\themes\async\layout\_partial\page\index.ejs:4
    2| <% if(theme.categorie_card.enable) { %>
    3|     <div class="row hidden-sm">
 >> 4|         <%
    5|             let cards = []
    6|             if (Array.isArray(theme.categorie_card.list)) {
    7|                 theme.categorie_card.list.forEach(title => {

site.categories.data.sort is not a function
    at eval ("C:\\Users\\tianx\\Desktop\\blog\\themes\\async\\layout\\_partial\\page\\index.ejs":23:46)
    at index (C:\Users\tianx\Desktop\blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiledSync (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:122:32)
    at _View.renderSync (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:64:29)
    at Object.partial (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\plugins\helper\partial.js:27:17)
    at eval ("C:\\Users\\tianx\\Desktop\\blog\\themes\\async\\layout\\index.ejs":16:14)
    at index (C:\Users\tianx\Desktop\blog\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiled (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:125:67)
    at _View.render (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\theme\view.js:50:21)
    at C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\hexo\index.js:58:29
    at tryCatcher (C:\Users\tianx\Desktop\blog\node_modules\bluebird\js\release\util.js:16:23)
    at C:\Users\tianx\Desktop\blog\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (C:\Users\tianx\Desktop\blog\node_modules\hexo\dist\hexo\router.js:43:9)
    at Readable.read (node:internal/streams/readable:496:12)
    at resume_ (node:internal/streams/readable:999:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

tips: 正在尝试更换主题,最新的Hexo版本出现如上报错,在Hexo 6.3.0下可以正常使用(配置还没调完

image

出现问题网站 | Website

https://blog.tnxg.top

@MaLuns
Copy link
Owner

MaLuns commented Apr 3, 2023

应该是 Hexo 的 site.categories 变量数据结构发生了变化,等 Hexo 正式版发布后会跟进

MaLuns pushed a commit that referenced this issue Apr 4, 2023
@MaLuns MaLuns closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants