lavas-project / hexo-pwa

Hexo PWA plugin
MIT License
133 stars 17 forks source link

【Bug Report】FATAL YAMLException: unknown tag !<tag:yaml.org,2002:js/regexp> (153:44) #18

Closed QuestionMark001 closed 2 years ago

QuestionMark001 commented 2 years ago

Use hexo clean found a bug:

$ hexo clean
FATAL YAMLException: unknown tag !<tag:yaml.org,2002:js/regexp> (153:44)

 150 |  ...
 151 |  ... TimeoutSeconds: 5
 152 |  ...
 153 |  ... rn: !!js/regexp /hm.baidu.com/
------------------------------------------^
 154 |  ... egy: networkOnly
 155 |  ... rn: !!js/regexp /.*\.(js|css|jpg|jpeg|png|gif)$/
    at generateError (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:183:10)
    at throwError (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:187:9)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1521:7)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockSequence (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1008:5)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1440:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readDocument (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1625:3)
    at loadDocuments (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1688:5)
    at Object.load (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1714:19)
    at Hexo.yamlHelper (D:\hexo\myblog\node_modules\hexo\lib\plugins\renderer\yaml.js:7:15)
    at Hexo.tryCatcher (D:\hexo\myblog\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (D:\hexo\myblog\node_modules\bluebird\js\release\method.js:15:34)
    at D:\hexo\myblog\node_modules\hexo\lib\hexo\render.js:81:22
    at tryCatcher (D:\hexo\myblog\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\hexo\myblog\node_modules\bluebird\js\release\promise.js:547:31) {
  reason: 'unknown tag !<tag:yaml.org,2002:js/regexp>',
  mark: {
    name: null,
    buffer: '# Hexo Configuration\n' +
      '## Docs: https://hexo.io/docs/configuration.html\n' +
      '## Source: https://github.com/hexojs/hexo/\n' +
      '\n' +
      '# Site\n' +
      "title: QuestionMark001's Blog\n" +
      "subtitle: 'Be thankful and be gentle.'\n" +
      "description: 'QuestionMark001的个人博客'\n" +
      'keywords: 个人博客,Linux,GitHub,C,python,Go,C#,C++,Java,HTML5,NodeJs,Hexo,VueJs\n' +
      'author: QuestionMark001-向阳菌\n' +
      'language: zh-CN\n' +
      "timezone: ''\n" +
      '\n' +
      '# URL\n' +
      "## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'\n" +
      'url: https://questionmark001.github.io\n' +
      'permalink: :year/:month/:day/:title/\n' +
      'permalink_defaults:\n' +
      'pretty_urls:\n' +
      "  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks\n" +
      "  trailing_html: true # Set to false to remove trailing '.html' from permalinks\n" +
      '\n' +
      '# Directory\n' +
      'source_dir: source\n' +
      'public_dir: public\n' +
      'tag_dir: tags\n' +
      'archive_dir: archives\n' +
      'category_dir: categories\n' +
      'code_dir: downloads/code\n' +
      'i18n_dir: :lang\n' +
      'skip_render:\n' +
      '  - "wechat/*"\n' +
      '\n' +
      '# Writing\n' +
      'new_post_name: :title.md # File name of new posts\n' +
      'default_layout: post\n' +
      'titlecase: false # Transform title into titlecase\n' +
      'external_link:\n' +
      '  enable: true # Open external links in new tab\n' +
      '  field: site # Apply to the whole site\n' +
      "  exclude: ''\n" +
      'filename_case: 0\n' +
      'render_drafts: false\n' +
      'post_asset_folder: false\n' +
      'relative_link: false\n' +
      'future: true\n' +
      'highlight:\n' +
      '  enable: true\n' +
      '  line_number: true\n' +
      '  auto_detect: false\n' +
      "  tab_replace: ''\n" +
      '  wrap: true\n' +
      '  hljs: false\n' +
      'prismjs:\n' +
      '  enable: false\n' +
      '  preprocess: true\n' +
      '  line_number: true\n' +
      "  tab_replace: ''\n" +
      '\n' +
      '# Home page setting\n' +
      "# path: Root path for your blogs index page. (default = '')\n" +
      '# per_page: Posts displayed per page. (0 = disable pagination)\n' +
      '# order_by: Posts order. (Order by date descending by default)\n' +
      'index_generator:\n' +
      "  path: ''\n" +
      '  per_page: 10\n' +
      '  order_by: -date\n' +
      '\n' +
      '# Category & Tag\n' +
      'default_category: uncategorized\n' +
      'category_map:\n' +
      'tag_map:\n' +
      '\n' +
      '# Metadata elements\n' +
      '## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta\n' +
      'meta_generator: true\n' +
      '\n' +
      '# Date / Time format\n' +
      '## Hexo uses Moment.js to parse and display date\n' +
      '## You can customize the date format as defined in\n' +
      '## http://momentjs.com/docs/#/displaying/format/\n' +
      'date_format: YYYY-MM-DD\n' +
      'time_format: HH:mm:ss\n' +
      "## updated_option supports 'mtime', 'date', 'empty'\n" +
      "updated_option: 'mtime'\n" +
      '\n' +
      '# Pagination\n' +
      '## Set per_page to 0 to disable pagination\n' +
      'per_page: 10\n' +
      'pagination_dir: page\n' +
      '\n' +
      '# Include / Exclude file(s)\n' +
      "## include:/exclude: options only apply to the 'source/' folder\n" +
      'include:\n' +
      'exclude:\n' +
      'ignore:\n' +
      '\n' +
      '# Extensions\n' +
      '## Plugins: https://hexo.io/plugins/\n' +
      '## Themes: https://hexo.io/themes/\n' +
      'theme: stun\n' +
      '\n' +
      '# Deployment\n' +
      '## Docs: https://hexo.io/docs/one-command-deployment\n' +
      'deploy:\n' +
      "  type: 'git'\n" +
      '  repository: git@github.com:QuestionMark001/QuestionMark001.github.io.git\n' +
      '  branch: main\n' +
      '\n' +
      '# Feed\n' +
      'feed:\n' +
      '  enable: true\n' +
      '  type: atom\n' +
      '  path: atom.xml\n' +
      '  limit: 20\n' +
      '  hub:\n' +
      '  content:\n' +
      '  content_limit: 140\n' +
      "  content_limit_delim: ' '\n" +
      '  order_by: -date\n' +
      '  icon: icon.png\n' +
      '  autodiscovery: true\n' +
      '  template:\n' +
      '\n' +
      '# Pwa\n' +
      'pwa:\n' +
      '  manifest:\n' +
      '    path: /manifest.json\n' +
      '    body:\n' +
      `      "name": "QuestionMark001's Blog"\n` +
      '      "short_name": "QuestionMark001"\n' +
      '      "theme_color": "rgba(203,7,83,0.86)"\n' +
      '      "background_color": "#ffffff"\n' +
      '      "display": "standalone"\n' +
      '      "Scope": "/"\n' +
      '      "start_url": "/"\n' +
      '      icons:\n' +
      '        - src: /android-chrome-192x192.png\n' +
      '          sizes: 192x192\n' +
      '          type: image/png\n' +
      '        - src: /android-chrome-512x512.png\n' +
      '          sizes: 512x512\n' +
      '          type: image/png\n' +
      '  serviceWorker:\n' +
      '    path: /sw.js\n' +
      '    preload:\n' +
      '      urls:\n' +
      '        - /\n' +
      '      posts: 5\n' +
      '    opts:\n' +
      '      networkTimeoutSeconds: 5\n' +
      '    routes:\n' +
      '      - pattern: !!js/regexp /hm.baidu.com/\n' +
      '        strategy: networkOnly\n' +
      '      - pattern: !!js/regexp /.*\\.(js|css|jpg|jpeg|png|gif)$/\n' +
      '        strategy: cacheFirst\n' +
      '      - pattern: !!js/regexp /\\//\n' +
      '        strategy: networkFirst\n' +
      '  priority: 5\n',
    position: 3579,
    line: 152,
    column: 43,
    snippet: ' 150 |  ... \n' +
      ' 151 |  ... TimeoutSeconds: 5\n' +
      ' 152 |  ... \n' +
      ' 153 |  ... rn: !!js/regexp /hm.baidu.com/\n' +
      '------------------------------------------^\n' +
      ' 154 |  ... egy: networkOnly\n' +
      ' 155 |  ... rn: !!js/regexp /.*\\.(js|css|jpg|jpeg|png|gif)$/'
  }
}