Closed shigeru-sakurai closed 4 years ago
when i build project After seted docusaurus.config.js as follows
docusaurus.config.js
plugins: [ [ require.resolve('@cmfcmf/docusaurus-search-local'), { language: ['ja'], }, ], ],
An error has occurred related lunr
TypeError: lunr.TinySegmenter is not a constructor at /home/user/project/node_modules/lunr-languages/lunr.ja.js:88:21
I looked around node_modules/lunr-languages/lunr.ja.js and finded tinyseg.js so Made it read it. build is done and i could search word with japanese.
node_modules/lunr-languages/lunr.ja.js
tinyseg.js
require('./tinyseg.js')(lunr) // + add var segmenter = new lunr.TinySegmenter() // インスタンス生成
Sorry if my English is weird.
Thank you for bringing this up! It should be fixed in https://github.com/cmfcmf/docusaurus-search-local/commit/871cca9635a6fcd4d829c7b9916d038e5aacd97d. I released version 0.3.0 that includes this fix.
Problem
when i build project After seted
docusaurus.config.js
as followsAn error has occurred related lunr
Guess about revision
I looked around
node_modules/lunr-languages/lunr.ja.js
and findedtinyseg.js
so Made it read it. build is done and i could search word with japanese.Sorry if my English is weird.