aleen42 / gitbook-footer

:black_nib: A gitbook-plugin for adding footer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected token u in JSON at position 0

elicec opened this issue · comments

According to your configuration, an error “Unexpected token u in JSON at position 0 ”

how to solve it

commented

Can you show me your configuration of book, set in the file book.json

I hit the same issue, the configuration likes

"page-footer": {
          "description": "modified at",
          "signature": "Kylin Soong . Docs",
                        "wisdom": "What we achieve inwardly will change outer reality.",
                        "format": "yyyy-MM-dd hh:mm:ss",
                        "copyright": "Copyright © Kylin Soong(宋志麒)",
                        "timeColor": "#666",
                        "copyrightColor": "#666",
                        "utcOffset": "8",
                        "isShowQRCode": true,
                        "baseUri": "http://ksoong.org/docs/content/",
                        "isShowIssues": true,
                        "repo": "kylinsoong/docs",
                        "issueNum": "8",
                        "token": "",
                        "style": "normal"
      }

The Error Logs looks

clear successfully
failed to get issues with token: undefined
error: error while generating page "README.adoc": 

Template render error: (/home/kylin/src/docs/README.adoc)
  SyntaxError: Unexpected token u in JSON at position 0
Template render error: (/home/kylin/src/docs/README.adoc)
  SyntaxError: Unexpected token u in JSON at position 0
    at Object.exports.prettifyError (/home/kylin/.gitbook/versions/3.2.3/node_modules/nunjucks/src/lib.js:34:15)
    at /home/kylin/.gitbook/versions/3.2.3/node_modules/nunjucks/src/environment.js:486:31
    at new_cls.root [as rootRenderFunc] (eval at _compile (/home/kylin/.gitbook/versions/3.2.3/node_modules/nunjucks/src/environment.js:565:24), <anonymous>:24:3)
    at new_cls.render (/home/kylin/.gitbook/versions/3.2.3/node_modules/nunjucks/src/environment.js:479:15)
    at new_cls.renderString (/home/kylin/.gitbook/versions/3.2.3/node_modules/nunjucks/src/environment.js:327:21)
    at Promise.apply (/home/kylin/.gitbook/versions/3.2.3/node_modules/q/q.js:1165:26)
    at Promise.promise.promiseDispatch (/home/kylin/.gitbook/versions/3.2.3/node_modules/q/q.js:788:41)
    at /home/kylin/.gitbook/versions/3.2.3/node_modules/q/q.js:1391:14
    at runSingle (/home/kylin/.gitbook/versions/3.2.3/node_modules/q/q.js:137:13)
    at flush (/home/kylin/.gitbook/versions/3.2.3/node_modules/q/q.js:125:13)
commented

It seems like a bug of the process during extracting token from process.env, and I will fix it in the next version.

commented

Check the version 5.3.5 and the problem should be solved after it. @kylinsoong @elicec

Thanks @aleen42, the Unexpected token u in JSON at position 0 verified be fixed