jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.22k stars 1.3k forks source link

[Bug]: 聊天按钮报错 TypeError: window.chatBtnFn is not a function #1543

Closed Yang-qwq closed 3 months ago

Yang-qwq commented 3 months ago

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

4.13.0

是否修改過主題文件? | Has the theme files been modified?

否 (No)

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

Edge

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

Windows

依賴插件 | Package dependencies information

hexo-site@0.0.0 D:\Data\hexo
├── bindings@1.5.0 extraneous
├── file-uri-to-path@1.0.0 extraneous
├── hexo-abbrlink@2.2.1
├── hexo-baidu-url-submit@0.0.6
├── hexo-butterfly-artitalk@1.0.4
├── hexo-butterfly-hpptalk@1.0.4
├── hexo-filter-nofollow@2.0.2
├── hexo-generator-archive@2.0.0
├── hexo-generator-baidu-sitemap@0.1.9
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-sitemap@3.0.1
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.3.0
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-spoiler@1.7.4
├── hexo-tag-aplayer@3.0.4
├── hexo-tag-bilibili@0.3.1
├── hexo-tag-hint@0.3.1
├── hexo-theme-landscape@1.0.0
├── hexo-util@3.3.0
├── hexo@7.3.0
├── markdown-it-ruby@0.1.1
└── nan@2.20.0 extraneous

問題描述 | Describe the bug

点击网站中出现的聊天按钮后无反应,查看控制台有如下报错: image

main.js:604 
 Uncaught 
TypeError: window.chatBtnFn is not a function
    at chat-btn (main.js:604:14)
    at HTMLDivElement.<anonymous> (main.js:614:30)
chat-btn    @   main.js:604
(匿名)    @   main.js:614

出現問題的網站 | Website with the issue

https://www.march7th.cn/

Yang-qwq commented 3 months ago

这是我正在使用的配置文件(themes\butterfly_config.yml):

# --------------------------------------
# Chat Services
# --------------------------------------

chat:
  # Choose: chatra/tidio/daovoice/crisp/messenger
  # Leave it empty if you don't need chat
  use: chatra
  # Chat Button [recommend]
  # It will create a button in the bottom right corner of website, and hide the origin button
  rightside_button: true
  # The origin chat button is displayed when scrolling up, and the button is hidden when scrolling down
  button_hide_show: true

# https://chatra.io/
chatra:
  id: ***

# https://www.tidio.com/
tidio:
  public_key:

# http://dashboard.daovoice.io/app
daovoice:
  app_id:

# https://crisp.chat/en/
crisp:
  website_id:

# https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin/
messenger:
  pageID:
  lang: zh_CN
jerryc127 commented 3 months ago

我沒有看到網頁加載 chatra

你是用 哪一個版本的?

你這個配置是 5.0 測試版的配置啊

Yang-qwq commented 3 months ago

抱歉,这是我朋友的博客,我也不清楚他是怎么用上测试版的,我现在在尝试帮他解决问题,你可以去问问他本人@luomo66ccff

Yang-qwq commented 3 months ago

问题已解决,非常感谢