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]: 无法载入Waline的评论 #1418

Closed
GuGuGee opened this issue Dec 20, 2023 · 6 comments
Closed

[Bug]: 无法载入Waline的评论 #1418

GuGuGee opened this issue Dec 20, 2023 · 6 comments

Comments

@GuGuGee
Copy link

GuGuGee commented Dec 20, 2023

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.11.0

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

不是 (No)

使用的瀏覽器? || What browse are you using?

Chrome

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

macOS

依賴插件 | Package dependencies Information

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
hexo-site@0.0.0 /Users/royleo/syncthing_data/laoda
├── gulp@4.0.2
├── gulp-imagemin@6.2.0
├── gulp-minify-css@1.2.4
├── gulp-minify-html@1.0.6
├── gulp-uglify@3.0.2
├── hexo@6.3.0
├── hexo-deployer-git@4.0.0
├── hexo-filter-nofollow@2.0.2
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-feed@3.0.0
├── hexo-generator-index-pin-top@0.2.2
├── hexo-generator-search@2.4.3
├── hexo-generator-sitemap@3.0.1
├── hexo-generator-tag@2.0.0
├── hexo-offline@2.0.1
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.1.1
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@3.0.0
├── hexo-server@3.0.0
├── hexo-theme-landscape@1.0.0
└── hexo-wordcount@6.0.1

問題描述 | Describe the bug

之前一直用的Waline和Twikoo作为博客的主副评论功能,功能都正常,两个评论都能使用。

前阵子突然发现Waline的评论加载不出来了。

首先我检查了Waline的服务是否正常,测试是正常的,地址:https://waline.gugu.ee/

然后我检查了主题配置文件:

comments:
  # Up to two comments system, the first will be shown as default
  # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk
  use: Twikoo,Waline # Valine,Disqus
  text: true # Display the comment name next to the button
  # lazyload: The comment system will be load when comment element enters the browser's viewport.
  # If you set it to true, the comment count will be invalid
  lazyload: true
  count: true # Display comment count in post's top_img
  card_post_count: true # Display comment count in Home Page
  # waline - A simple comment system with backend support fork from Valine
# https://waline.js.org/
waline:
  serverURL: https://waline.gugu.ee # Waline server address url
  bg: # waline background
  pageview: false
  option:
# Twikoo
# https://github.com/imaegoo/twikoo
twikoo:
  envId: https://talk.gugu.ee/
  region:
  visitor: true
  option:

同样也没改过,不知道是什么原因一直无法加载。
PS:我在无痕模式下也尝试了,一样无法加载。

目前只好暂时把Twikoo作为了主评论系统来使用了 = = 但是我的很多评论都在Waline中,所以希望作者能帮忙看一下是什么原因导致的Waline无法加载,非常感谢!

出現問題網站 | Website

https://blog.laoda.de/

@jerryc127
Copy link
Owner

jerryc127 commented Dec 20, 2023

waline 3.0 waline js 使用 ES Module 作为默认导出形式, 主题使用的引用方法会报错

你可以这样解决

  1. 把 配置文件中的 CDN 的 version 设为 true

  2. 你可以修改CDN

强制使用v2

    waline_css: https://cdn.jsdelivr.net/npm/@waline/client@2/dist/waline.css
    waline_js: https://cdn.jsdelivr.net/npm/@waline/client@2/dist/waline.min.js

如果你想使用新的 v3,可以 改成这样 (不建议,有可能之后的测试版会去掉)

    waline_css: https://cdn.jsdelivr.net/npm/@waline/client@3.0.0-alpha.8/dist/waline.min.css
    waline_js: https://cdn.jsdelivr.net/npm/@waline/client@3.0.0-alpha.8/dist/waline.umd.min.js

@jerryc127 jerryc127 pinned this issue Dec 20, 2023
@GuGuGee
Copy link
Author

GuGuGee commented Dec 21, 2023

强制使用v2之后评论可以显示了,非常感谢Jerry!

@Aerosand
Copy link

请教一下,怎么强制修改 CDN 呢?

@CCKNBC
Copy link
Contributor

CCKNBC commented Dec 27, 2023

@Aerosand ccknbc-actions/blog-butterfly@a05e73d

themes/butterfly/plugins.yml

如果配置没开启 Version 就这样强制锁定哦

@Aerosand
Copy link

@CCKNBC 超级感谢~

@SineObama
Copy link

SineObama commented Jan 21, 2024

如果你想使用新的 v3,可以 改成这样 (不建议,有可能之后的测试版会去掉)

    waline_css: https://cdn.jsdelivr.net/npm/@waline/client@3.0.0-alpha.8/dist/waline.min.css
    waline_js: https://cdn.jsdelivr.net/npm/@waline/client@3.0.0-alpha.8/dist/waline.umd.min.js

我发现 https://waline.js.org/reference/client/file.html 提供了 UMD 格式的文件dist/waline.umd.js,我感觉这个也可以正常使用吧。

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

5 participants