Search function broken?
If I try to search the doc online, using the search in the upper left corner, it fails with stack trace:
Uncaught TypeError: Cannot read property 'tf' of undefined
at t.Index.documentVector (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8688)
at t.Index.<anonymous> (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8449)
at Array.map (native)
at t.SortedSet.map (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:4292)
at t.Index.search (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8396)
at LunrSearchEngine.search (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/search-lunr.js:34:40)
at Object.query (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search-engine.js:31:23)
at launchSearch (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:79:33)
at handleUpdate (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:121:17)
at HTMLInputElement.<anonymous> (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:142:13)
t.Index.documentVector @ lunr.min.js:7
(anonymous) @ lunr.min.js:7
t.SortedSet.map @ lunr.min.js:7
t.Index.search @ lunr.min.js:7
LunrSearchEngine.search @ search-lunr.js:34
query @ search-engine.js:31
launchSearch @ search.js:79
handleUpdate @ search.js:121
(anonymous) @ search.js:142
dispatch @ gitbook.js:2
m.handle @ gitbook.js:2
https://twitter.com/basarat/status/852021412596334592
/cc @gitbookio :rose:
Thanks. But leaving open till its fixed by gitbook :rose:
I'm still experiencing this issue on the deployed version of the site - same error in the console
Still broken. A weak, perhaps obvious workaround is to google for
site:https://basarat.gitbooks.io <your-search-terms>
and then search within the page using your browser "find".
I tried without success to find an issue on https://github.com/GitbookIO/plugin-search, https://github.com/GitbookIO/plugin-lunr, or https://github.com/GitbookIO/gitbook that relates to this. @basarat, Are you sure this isn't a book-specific problem? Might it make sense to submit an issue (probably on https://github.com/GitbookIO/plugin-lunr)?
(I know nothing about GitBook, beyond what I dug up for this comment.)
I've made my config https://github.com/basarat/typescript-book/blob/master/book.json same as mobx https://github.com/mobxjs/mobx/blob/gh-pages/docs/book.json But its still not working :( So definitely not an issue with with our config
Adding this to book.json fixed the problem.
I think it was happening because of some emojis I used in my book.
{
"pluginsConfig": {
"lunr": {
"ignoreSpecialCharacters": true
}
}
}
I also reported this here: https://github.com/GitbookIO/plugin-lunr/issues/3
@Pitasi that fixed it. Thank you soo much! :rose: