cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
446 stars 67 forks source link

when i seted "language: ['ja']" and build ,An error has occurred related lunr #12

Closed shigeru-sakurai closed 4 years ago

shigeru-sakurai commented 4 years ago

Problem

when i build project After seted docusaurus.config.js as follows

  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

Guess about revision

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.

Sorry if my English is weird.

cmfcmf commented 4 years ago

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.