hexo: FATAL RangeError: Invalid string length

Check List

Please check followings before submitting a new issue.

I don’t know why this error occurs. Even though yesterday it was okay.

  • I didn’t change anything in the code
  • I didn’t modify the theme, even if I changed the theme many times, the error still persists.
  • I didn’t modify any plugins LOG Workflow This error persist on hexo generate
FATAL {
  err: RangeError: Invalid string length
      at JSON.stringify (<anonymous>)
      at _Model._export (/media/dimaslanjaka/DATA/Repositories/gh-pages/node_modules/warehouse/lib/model.js:932:17)
      at exportAsync (/media/dimaslanjaka/DATA/Repositories/gh-pages/node_modules/warehouse/lib/database.js:50:44)
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

Environtment

hexo: 6.0.0
hexo-cli: 4.3.0
os: linux 5.13.0-37-generic Zorin OS 16.1
node: 14.18.1
v8: 8.4.371.23-node.84
uv: 1.42.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.17.2
modules: 83
nghttp2: 1.42.0
napi: 8
llhttp: 2.1.4
openssl: 1.1.1l
cldr: 39.0
icu: 69.1
tz: 2021a
unicode: 13.0

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Now iam using my own task and removing a lot of plugins from hexo project. Now i can fix seo, external links (anonymizing), optimize images automatically with separated task using gulp. disvantages is the process taking more times, but works.

posts total: 1419 (exclude pages) RAM my pc: 8 GB Hardisk type: HDD processor engine: https://github.com/dimaslanjaka/static-blog-generator-hexo/tree/master/packages/gulp-sbg deployed to: https://github.com/dimaslanjaka/dimaslanjaka.github.io -> https://www.webmanajemen.com/

I found that the external_link filter is consuming a huge amount of memory. You can try to disable it in _config.yml

external_link:
  enable: false

See also #3886

You can use Heap Profiler to inspect memory issues.

https://github.com/hexojs/hexo/blob/ca51e15072321577d7cf7dd133d21564a3d54da5/lib/plugins/filter/after_render/external_link.js#L21

This function takes up about 2G of memory and I’m not sure what the reason is

now i fork some hexojs functions to create my own generator https://github.com/dimaslanjaka/dimaslanjaka.github.io/tree/compiler

my own generator work for huge posts. might helpful for hexojs dev to improve the HexoJS package