解决GitBook RangeError: Maximum call stack size exceeded

问题描述

在编写Gitbook的过程中,在启动gitbook serve预览的时候,发生了错误RangeError: Maximum call stack size exceeded

解决GitBook RangeError: Maximum call stack size exceeded_第1张图片

解决方案

https://github.com/GitbookIO/plugin-lunr/blob/master/README.md#limitations

解决GitBook RangeError: Maximum call stack size exceeded_第2张图片

lunr

This plugin provides a backend for the search plugin.

This plugin is a default plugin.

Disable this plugin

This is a default plugin and it can be disabled using a book.json configuration:

{
    "plugins": ["-lunr"]
}

Limitations

Lunr can't index a huge book, by default the index size is limited at ~100ko.

You can change this limit by settings the configuration maxIndexSize:

{
    "pluginsConfig": {
        "lunr": {
            "maxIndexSize": 200000
        }
    }
}

在GitBook项目的根目录创建book.json,禁用lunr插件

$ vim book.json

$ ls
_book/     Chapter10/  Chapter3/  Chapter6/  Chapter9/
book.json  Chapter11/  Chapter4/  Chapter7/  README.md
Chapter1/  Chapter2/   Chapter5/  Chapter8/  SUMMARY.md

$ cat book.json
{
    "plugins": ["-lunr"]
}

再次启动预览看看还有没报错

解决GitBook RangeError: Maximum call stack size exceeded_第3张图片

此时,使用gitbook serve已经没有问题了,但是使用gitbook build --gitbook=2.6.7依然报错。

使用gitbook build --gitbook=2.6.7 依然报错

解决GitBook RangeError: Maximum call stack size exceeded_第4张图片

单纯使用gitbook build的时候不会报错,而制定gitbook 版本导出的时候则报错,说明制定版本的时候,并没有禁用lunr插件。

所以,这种方法不能解决这种降低版本的gitbook build的情况。

解决GitBook RangeError: Maximum call stack size exceeded_第5张图片

你可能感兴趣的:(解决GitBook RangeError: Maximum call stack size exceeded)