MihaiValentin/lunr-languages

lunr.TinySegmenter is not a constructor on lunr.ja file

joanv38 opened this issue · 1 comments

Hello, I require your help if someone already saw this problem.
I use mkdocs and so to build the search I specify the lang with ja.
I tried with 5 or 6 different language, all work except this one, this error is show all the time:
lunr.TinySegmenter is not a constructor
at lunr.ja.js:86
at lunr.ja.js:36
at lunr.ja.js:38
at loadScripts (worker.js:29)
at XMLHttpRequest.onJSONLoaded (worker.js:53)
Does someone already saw this error and found a way to fix it?

I'm still working on it so if I find the solution I will post it.
Thank you

Ok so at the end it's because mkdocs build doesn't import the tinyseg.js and of course doesn't load it(so this issues is not with lunr but with mkdocs.
Just for information, a manual import + add the line
if (lang[i] != 'en') {
scriptsToLoad.push('tinyseg.js');
}
on worker.js will fix it.

Kind regards