jerryc127 / hexo-theme-butterfly

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

[Bug]: Hexo did not work after upgrading butterfly. #1371

Closed LittleNewton closed 1 year ago

LittleNewton commented 1 year ago

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

4.10.0-b2

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

不是 (No)

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

Chrome

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

Windows

問題描述 | Describe the bug

Hi there,

I am using hexo as my blog for several weeks. Today I upgrade butterfly theme by git pull and my blog got vanished.

After checking the docker logs, I got the following content.

INFO  Start processing
INFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
(node:17) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
Unhandled rejection TypeError: /app/themes/butterfly/layout/includes/head.pug:32
    30| 
    31| //- 預解析
  > 32| !=partial('includes/head/preconnect', {}, {cache: true})
    33| 
    34| //- 網站驗證
    35| !=partial('includes/head/site_verification', {}, {cache: true})
/app/themes/butterfly/layout/includes/head/preconnect.pug:1
  > 1| -
    2|   const { internal_provider, third_party_provider, custom_format } = theme.CDN
    3|   const providers = {
    4|     'jsdelivr': '//cdn.jsdelivr.net',
Cannot read properties of null (reading 'match')
    at eval (eval at wrap (/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:13:27)
    at template (eval at wrap (/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:64:7)
    at _View._compiledSync (/app/node_modules/hexo/dist/theme/view.js:122:32)
    at _View.renderSync (/app/node_modules/hexo/dist/theme/view.js:64:29)
    at /app/node_modules/hexo/dist/plugins/helper/partial.js:25:56
    at Cache.apply (/app/node_modules/hexo/node_modules/hexo-util/dist/cache.js:22:21)
    at Object.fragmentCache (/app/node_modules/hexo/dist/plugins/helper/fragment_cache.js:9:26)
    at Object.partial (/app/node_modules/hexo/dist/plugins/helper/partial.js:25:21)
    at eval (eval at wrap (/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:86:46)
    at template (eval at wrap (/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:5876:7)
    at _View._compiled (/app/node_modules/hexo/dist/theme/view.js:125:67)
    at _View.render (/app/node_modules/hexo/dist/theme/view.js:50:21)
    at /app/node_modules/hexo/dist/hexo/index.js:58:29
    at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
    at /app/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/app/node_modules/hexo/dist/hexo/router.js:43:9)
    at Readable.read (node:internal/streams/readable:515:12)
    at resume_ (node:internal/streams/readable:1016:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

This is my plugins:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "7.0.0-rc2"
  },
  "dependencies": {
    "hexo": "^7.0.0-rc2",
    "hexo-admin": "^2.3.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-i18n": "^0.0.10",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-search": "^2.4.3",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-markdown-it": "^7.1.0",
    "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"
  }
}

My website can only be accessed by IPv6.

出現問題網站 | Website

https://littlenewton.cn/

LittleNewton commented 1 year ago

All my data and config have been kept safe and sound.

LittleNewton commented 1 year ago

Hi,

After removing preconnect.pug CDN-related contents, access to my website is available.

image

jerryc127 commented 1 year ago

Can you provide the content of config file ? Only need CDN part.

LittleNewton commented 1 year ago

Hi Jerry,

This is the CDN part of my _config.butterfly.yaml file.

# CDN
# Don't modify the following settings unless you know how they work
# 非必要請不要修改
CDN:
  # The CDN provider of internal scripts (主題內部 js 的 cdn 配置)
  # option: local/jsdelivr/unpkg/cdnjs/custom
  # Dev version can only choose. ( dev版的主題只能設置為 local )
  internal_provider: local

  # The CDN provider of third party scripts (第三方 js 的 cdn 配置)
  # option: local/jsdelivr/unpkg/cdnjs/custom
  # when set it to local, you need to install hexo-butterfly-extjs
  third_party_provider: jsdelivr

  # Add version number to url, true or false
  version: false

  # Custom format
  # For example:
https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
  custom_format:

  option:
    # main_css:
    # main:
    # utils:
    # translate:
    # local_search:
    # algolia_js:
    # algolia_search:
    # instantsearch:
    # docsearch_js:
    # docsearch_css:
    # pjax:
    # gitalk:
    # gitalk_css:
    # blueimp_md5:
    # valine:
    # disqusjs:
    # disqusjs_css:
    # twikoo:
    # waline_js:
    # waline_css:
    # giscus:
    # sharejs:
    # sharejs_css:
    # mathjax:
    # katex:
    # katex_copytex:
    # mermaid:
    # canvas_ribbon:
    # canvas_fluttering_ribbon:
    # canvas_nest:
    # lazyload:
    # instantpage:
    # typed:
    # pangu:
    # fancybox_css:
    # fancybox:
    # medium_zoom:
    # snackbar_css:
    # snackbar:
    # activate_power_mode:
    # fireworks:
    # click_heart:
    # ClickShowText:
    # fontawesome:
    # flickr_justified_gallery_js:
    # flickr_justified_gallery_css:
    # aplayer_css:
    # aplayer_js:
    # meting_js:
    # prismjs_js:
    # prismjs_lineNumber_js:
    # prismjs_autoloader:
    # artalk_js:
    # artalk_css:
    # busuanzi:
    # abcjs_basic_js:

Jerry Wong @.***> 于2023年9月23日周六 19:59写道:

Can you provide the content of config file ? Only need CDN part.

— Reply to this email directly, view it on GitHub https://github.com/jerryc127/hexo-theme-butterfly/issues/1371#issuecomment-1732293063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHYCTCBNXA2KX4UWSIOUDDX33FJ3ANCNFSM6AAAAAA5ECEBFY . You are receiving this because you authored the thread.Message ID: @.***>