Skip to content

Utterances comment can't display normally by clicking but display normally when refreshing the page or accessing to the page directly with url #1307

@guoapeng

Description

@guoapeng

确保你在提交Bug反馈之前仔细阅读了Hexo文档Icarus用户指南,和GitHub issues来了解你的问题是否已经被他人提出过。

Bug描述
简洁清晰地描述你遇到的Bug是什么。

系统与环境
列出你的Hexo和Icarus的版本和配置。

hexo v
INFO  Validating config
Inferno is in development mode.
INFO  =======================================
 ██╗ ██████╗ █████╗ ██████╗ ██╗   ██╗███████╗
 ██║██╔════╝██╔══██╗██╔══██╗██║   ██║██╔════╝
 ██║██║     ███████║██████╔╝██║   ██║███████╗
 ██║██║     ██╔══██║██╔══██╗██║   ██║╚════██║
 ██║╚██████╗██║  ██║██║  ██║╚██████╔╝███████║
 ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
=============================================
INFO  === Checking package dependencies ===
INFO  === Checking theme configurations ===
INFO  === Registering Hexo extensions ===
hexo: 7.3.0
hexo-cli: 4.3.2
os: linux 6.8.8-300.fc40.x86_64 Fedora Linux 40 (Workstation Edition)
node: 20.12.2
acorn: 8.11.3
ada: 2.7.6
ares: 1.27.0
base64: 0.5.2
brotli: 1.1.0
cjs_module_lexer: 1.2.2
cldr: 44.1
icu: 74.2
llhttp: 8.1.2
modules: 115
napi: 9
nghttp2: 1.60.0
nghttp3: 0.7.0
ngtcp2: 0.8.1
openssl: 3.0.13+quic
simdutf: 4.0.8
tz: 2024a
undici: 5.28.4
unicode: 15.1
uv: 1.46.0
uvwasi: 0.0.20
v8: 11.3.244.8-node.19
zlib: 1.3.0.1-motley-40e35a7
  • 主题配置文件_config.icarus.ymlthemes/icarus/_config.yml
comment:
    type: utterances
    repo: guoapeng/guoapeng.github.io
    issue_term: pathname        # Required if issue_number is not set
    #issue_number: 100           # Required if issue_term is not set. Every post can be mapped to a separate, manually-created GitHub issue.
    #label: some-issue-label     # Optional
    theme: github-light         # Optional
  • 浏览器版本
  • (Chrome 版本 124.0.6367.118(正式版本)Fedora Project (64 位))
  • Firefox for Fedora 125.0.3

复现方式
列出复现这个Bug的步骤,如:

  1. 访问https://pengtech.net click on 友链,或者任何post, 例如this page, 没有评论界面。

而且打开 开发者工具>console中还有如下错误

Uncaught DOMException: Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent.
    at https://utteranc.es/client.js:1:1821
    at https://utteranc.es/client.js:1:2220
  1. 刷新或者按F5, 评论正常显示。

期望行为

无论用户通过点击,还是刷新页面,评论应该都能正常显示。
截图
通过点击访问页面,没有评论框。
image

控制台有错误提示:
image

页面渲染的html代码,没有评论框。
image

通过刷新页面(F5)或者直接通过url访问, 评论显示正常,html代码渲染正常。
image

额外上下文

  1. 刚刚从next主题迁移到icarus主题,在next 主题中使用Utterance评论是正常的。
    之前使用next主题Utterance comment没有类似的问题, 切换到icarus就有这个问题。

  2. 似乎shareThis widget也有同样的问题,点击到页面不显示,直接访问,或刷新页面就能正常显示。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:extensionIssues about widgets, comment, share, search, and plugins.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions