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

After hexo generate shows `RangeError: Invalid string length at JSON.stringify (<anonymous>)` #3254

Open
nickchan-aither opened this Issue Sep 7, 2018 · 1 comment

Comments

1 participant
@nickchan-aither

nickchan-aither commented Sep 7, 2018

Environment Info

Node version(node -v):
v8.9.1

Hexo and Plugin version:

├─ hexo-bunyan@1.0.0
├─ hexo-cli@1.0.4
├─ hexo-deployer-s3@0.2.333
├─ hexo-deployer-sync-s3@0.0.1
├─ hexo-front-matter@0.2.3
├─ hexo-fs@0.2.2
├─ hexo-generator-archive@0.1.5
├─ hexo-generator-category@0.1.3
├─ hexo-generator-i18n@0.0.7
├─ hexo-generator-index@0.2.1
├─ hexo-generator-json-content@3.0.1
├─ hexo-generator-seo-friendly-sitemap@0.0.21
├─ hexo-generator-tag@0.2.0
├─ hexo-i18n@0.2.1
├─ hexo-jquery@2.1.0
├─ hexo-log@0.2.0
├─ hexo-pagination@0.0.2
├─ hexo-renderer-ejs@0.2.0
├─ hexo-renderer-marked@0.2.11
├─ hexo-renderer-stylus@0.3.3
├─ hexo-server@0.2.2
├─ hexo-util@0.6.2
├─ hexo@3.4.3

For question

May I know how to fix the problem after running hexo generate?

It says RangeError: Invalid string length at JSON.stringify (<anonymous>), I search for it about out of the memory.

So then I changed bin/hexo with #!/usr/bin/env node --max_old_space_size=8192 --optimize_for_size --stack_size=8192.

But still the same problem. Anyone can help? Thank you.

$ hexo g
INFO  Start processing
INFO  Files loaded in 12 s
INFO  Generated: content.json
...
...
...
INFO  1579 files generated in 35 s
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at Database._Model.Model.Model._export (/Users/nickchan/workspace/web/node_modules/warehouse/lib/model.js:1002:15)
    at /Users/nickchan/workspace/web/node_modules/warehouse/lib/database.js:145:45
    at Promise._execute (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/debuggability.js:303:9)
    at Promise._resolveFromExecutor (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/promise.js:79:10)
    at Database.save (/Users/nickchan/workspace/web/node_modules/warehouse/lib/database.js:119:10)
    at Hexo.saveDatabaseFilter (/Users/nickchan/workspace/web/node_modules/hexo/lib/plugins/filter/before_exit/save_database.js:8:24)
    at Hexo.tryCatcher (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/nickchan/workspace/web/node_modules/hexo/lib/extend/filter.js:68:35
    at tryCatcher (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/reduce.js:155:18)
    at Object.gotAccum (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/reduce.js:144:25)
    at Object.tryCatcher (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/nickchan/workspace/web/node_modules/bluebird/js/release/promise.js:512:31)
@nickchan-aither

This comment has been minimized.

Show comment
Hide comment
@nickchan-aither

nickchan-aither Sep 11, 2018

Update 2018-09-11

The problem I found that seems happen when more than 100 files in source/_posts/news.

Any suggestion that can generate large posts of the website? Thank you.

nickchan-aither commented Sep 11, 2018

Update 2018-09-11

The problem I found that seems happen when more than 100 files in source/_posts/news.

Any suggestion that can generate large posts of the website? Thank you.

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