New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token u in JSON at position 0 #9

Closed
elicec opened this Issue Dec 28, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@elicec
Copy link

elicec commented Dec 28, 2017

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

how to solve it

@aleen42

This comment has been minimized.

Copy link
Owner

aleen42 commented Dec 28, 2017

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

@kylinsoong

This comment has been minimized.

Copy link

kylinsoong commented Jun 6, 2018

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)
@aleen42

This comment has been minimized.

Copy link
Owner

aleen42 commented Jun 6, 2018

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

@aleen42

This comment has been minimized.

Copy link
Owner

aleen42 commented Jun 6, 2018

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

@aleen42 aleen42 closed this Jun 6, 2018

@aleen42 aleen42 self-assigned this Jun 6, 2018

@aleen42 aleen42 added the bug label Jun 6, 2018

@kylinsoong

This comment has been minimized.

Copy link

kylinsoong commented Jun 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment