acyortjs/acyort

[可以复现]✖ TypeError: Cannot read property 'split' of null

Closed this issue · 2 comments

ly525 commented

我的github issues 地址:https://github.com/ly525/blog/issues
运行acyort build 到第11篇的时候,每次都会挂掉,麻烦帮忙看下,感谢🙏

i Use script: content.js
i Use script: active.js
i Getting data from GitHub (ly525/blog) ... 1
i Getting data from GitHub (ly525/blog) ... 2
i Getting data from GitHub (ly525/blog) ... 3
i Getting data from GitHub (ly525/blog) ... 4
i Getting data from GitHub (ly525/blog) ... 5
i Getting data from GitHub (ly525/blog) ... 6
i Getting data from GitHub (ly525/blog) ... 7
i Getting data from GitHub (ly525/blog) ... 8
i Getting data from GitHub (ly525/blog) ... 9
i Getting data from GitHub (ly525/blog) ... 10TypeError: Cannot read property 'split' of null
    at excerpt (/Users/ly/.nvm/versions/node/v8.9.3/lib/node_modules/acyort/node_modules/_acyort-processor@1.0.5@acyort-processor/lib/excerpt.js:3:25)
    at Object.post (/Users/ly/.nvm/versions/node/v8.9.3/lib/node_modules/acyort/node_modules/_acyort-processor@1.0.5@acyort-processor/lib/post.js:21:32)
    at posts.map (/Users/ly/.nvm/versions/node/v8.9.3/lib/node_modules/acyort/node_modules/_acyort-processor@1.0.5@acyort-processor/index.js:62:25)
    at Array.map (<anonymous>)
    at Object.processor (/Users/ly/.nvm/versions/node/v8.9.3/lib/node_modules/acyort/node_modules/_acyort-processor@1.0.5@acyort-processor/index.js:61:17)
    at extend.init.then.then.then.then.data (/Users/ly/.nvm/versions/node/v8.9.3/lib/node_modules/acyort/lib/acyort.js:113:26)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

config.yml

# Base

# site
title: 前端农场
description: 博客、分享、资源、源码

# url
# url of website. format like http://<domain>/<path> or https://<domain>
url:

# theme
# default is ccc45
theme:

# pagination
# post count per page. set 0 to disable it
# default is 10
per_page: 10

# menu
# navigation menus of website
menu:
  home: /
  categories: /categories/
  tags: /tags/
  about: /about/

# default category name
# default is "uncategorized"
default_category: blog

# content
# GitHub user/repository
# website contents comes from this repository issues
user: ly525
repository: blog


# Advance

# scripts
# script file names
scripts:
  - content.js
  - active.js

# plugins
# npm modules
plugins:
  # - xxx module

# output
# where static site files located
public_dir: /

# authors
# Github usernames, users whose issues can be generated to post
authors:
#  - author0
#  - author1

# timezone
# website timezone. use machine setting by default
# example: "America/New_York", "Japan", "UTC", or "Asia/Shanghai"
timezone:

# language
# language of website, theme support is needed
# default is default
language:

# code line numbers
# whether showing line numbers in code block
# default is true
line_numbers:

# order
# post ordering, order posts by issues create_time(created) or update_time(updated)
# default is created
order:

# directory
# subdirectory in public_dir
# default is categories, tags, posts
category_dir:
tag_dir:
post_dir:

# token
# github access token
# In order to prevent the token from removed by github, you should add a # inside it
# for example the original token abcdedf should be replaced with a#bcdef.
token:

# cache
# whether caching GitHub issues data, just for development
# default false
cache:

# Other
# customize some settings if necessary

# disqus:
# favicon:

现在 GitHub API 的数据返回跟之前测试时候有些出入,body 字段的返回如果 issue 内容为空,返回是 null,我之前认为是空字符串,所以引起问题

所以解决办法也简单,你先把那些没有内容的 issues 关掉,或者添加一些内容上去。

迟点这边更新一下,不过可能慢点,所以你还是先按照上面的做法吧

ly525 commented

好的,非常感谢!准备阅读您的项目源码,👍