GitbookIO / plugin-search

Search content in your book
Apache License 2.0
25 stars 16 forks source link

GLOSSARY.md broken on gitbook serve when plugin gitbook-search is enabled #16

Closed SteveClement closed 5 years ago

SteveClement commented 5 years ago

What is the current behavior?

Launching gitbook serve with a GLOSSARY.md crashes.

$ gitbook -V
CLI version: 2.3.2
GitBook version: 3.2.3
# Ubuntu 16.04.5 LTS (Also tested on Debian 9 sid)

What is the expected behavior?

No crash ;)

I tried an empty file. It crashes. A minimal file with only 1 entry. It crashes. NO file, it runs.

Temporary fix:

-search

in the plugins section...

See output:

$ gitbook -d serve
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: 15 plugins are installed 
info: 14 explicitly listed 
info: loading plugin "autocover"... OK 
info: loading plugin "github"... OK 
info: loading plugin "toc"... OK 
info: loading plugin "anchors"... OK 
info: loading plugin "alerts"... OK 
info: loading plugin "advanced-emoji"... OK 
info: loading plugin "image-class"... OK 
info: loading plugin "livereload"... OK 
info: loading plugin "highlight"... OK 
info: loading plugin "search"... OK 
info: loading plugin "lunr"... OK 
info: loading plugin "sharing"... OK 
info: loading plugin "fontsettings"... OK 
info: loading plugin "theme-default"... OK 
info: found 30 pages 
info: found 223 asset files 
warn: "options" property is deprecated, use config.get(key) instead 
warn: "options.generator" property is deprecated, use "output.name" instead 
warn: "sections" property is deprecated, use page.content instead 
warn: "contentLink" is deprecated, use "output.toURL()" instead 
warn: "page.progress" property is deprecated 
error: error while generating page "GLOSSARY.md": 

TypeError: Cannot read property 'title' of null
TypeError: Cannot read property 'title' of null
    at Object.page (/home/misp/misp-book/node_modules/gitbook-plugin-search/index.js:52:46)
    at /home/misp/.gitbook/versions/3.2.3/lib/output/callHook.js:48:29
    at /home/misp/.gitbook/versions/3.2.3/lib/utils/promise.js:22:20
    at _fulfilled (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:834:54)
    at /home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:863:30
    at Promise.promise.promiseDispatch (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:796:13)
    at /home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:604:44
    at runSingle (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:137:13)
    at flush (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)
SteveClement commented 5 years ago

The problem was an outdated version of the plugin.

Sorry.