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

Giscus render error #700

Closed
3 tasks done
tisonkun opened this issue Sep 18, 2023 · 5 comments
Closed
3 tasks done

Giscus render error #700

tisonkun opened this issue Sep 18, 2023 · 5 comments
Labels
Bug Something isn't working Solved

Comments

@tisonkun
Copy link
Contributor

tisonkun commented Sep 18, 2023

Issue Checklist

Expected behavior

正常构建。

Actual behavior

我不确定是 Giscus 插件的问题还是本仓库的问题,因为报在 node_modules/hexo-theme-next/layout 下我就先 report 在这里。

https://github.com/tisonkun/blog/tree/bf2e45004a4ba861de3a283da6aa8d90532b8a8c

https://blog-5evv3lisv-tisonkun.vercel.app/

INFO  Validating config
INFO  ==================================
  ███╗   ██╗███████╗██╗  ██╗████████╗
  ████╗  ██║██╔════╝╚██╗██╔╝╚══██╔══╝
  ██╔██╗ ██║█████╗   ╚███╔╝    ██║
  ██║╚██╗██║██╔══╝   ██╔██╗    ██║
  ██║ ╚████║███████╗██╔╝ ██╗   ██║
  ╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝   ╚═╝
========================================
NexT version 8.18.1
Documentation: https://theme-next.js.org
========================================
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
Unhandled rejection Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk) [Line 29, Column 25]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk) [Line 49, Column 17]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/head/head-unique.njk) [Line 19, Column 12]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk) [Line 3, Column 3]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/header/index.njk) [Line 6, Column 15]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk) [Line 5, Column 3]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/header/sub-menu.njk) [Line 2, Column 29]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/header/sub-menu.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk) [Line 10, Column 14]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/pagination.njk) [Line 2, Column 21]
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/comments.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_partials/languages.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_third-party/math/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/index.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/_third-party/quicklink.njk)
  Template render error: (/Users/tison/Brittani/blog/node_modules/hexo-theme-next/layout/inject/bodyEnd/giscus.njk)
  TypeError: Cannot read properties of undefined (reading 'replace')
    at Object._prettifyError (/Users/tison/Brittani/blog/node_modules/nunjucks/src/lib.js:32:11)
    at /Users/tison/Brittani/blog/node_modules/nunjucks/src/environment.js:464:19
    at Template.root [as rootRenderFunc] (eval at _compile (/Users/tison/Brittani/blog/node_modules/nunjucks/src/environment.js:527:18), <anonymous>:45:3)
    at Template.render (/Users/tison/Brittani/blog/node_modules/nunjucks/src/environment.js:454:10)
    at /Users/tison/Brittani/blog/node_modules/hexo/dist/plugins/renderer/nunjucks.js:62:39
    at _View._compiled (/Users/tison/Brittani/blog/node_modules/hexo/dist/theme/view.js:125:67)
    at _View.render (/Users/tison/Brittani/blog/node_modules/hexo/dist/theme/view.js:50:21)
    at /Users/tison/Brittani/blog/node_modules/hexo/dist/hexo/index.js:58:29
    at tryCatcher (/Users/tison/Brittani/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/tison/Brittani/blog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/tison/Brittani/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)

Steps to reproduce the behavior

Clone + yarn install + yarn hexo s

Node.js and NPM Information

v18.16.1
9.5.1

Package dependencies Information

..

Hexo Configuration

..

NexT Configuration

..

Other Information

No response

@tisonkun tisonkun added the Bug Something isn't working label Sep 18, 2023
@PeichengLiu
Copy link
Contributor

@PeichengLiu
Copy link
Contributor

@stevenjoezhang 为什么对 giscus 的支持以插件形式存在?我自己仿照 gitalk 的配置写了一份才发现有这么个插件。

@stevenjoezhang
Copy link
Member

hexo-next-giscus 已发布新版本,更新一下即可

npm i hexo-next-giscus@1.2.0

独立出插件的原因是目前 NexT 里面集成的评论数量太多了,有 7 个评论系统以插件形式发布: https://github.com/next-theme/awesome-next?tab=readme-ov-file#comment

@tisonkun
Copy link
Contributor Author

验证有效 - https://www.tisonkun.org/2023/09/16/oss-develop/

BTW 最新一篇博客也提到了 NexT 项目,感谢一直以来的开发维护 :D

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Solved
Projects
None yet
Development

No branches or pull requests

3 participants