I know everyone's getting Kuroshiro is not a constructor and resolves the problem with adding a default
But i don't see anyone getting this weird error as mine:
KuromojiAnalyzer is not a constructor
TypeError: KuromojiAnalyzer is not a constructor
My code is:
const Kuroshiro = require("kuroshiro").default;
const KuromojiAnalyzer = require("kuroshiro-analyzer-kuromoji");
function someComponent({ text }) {
const kuroshiro = new Kuroshiro();
const analyzer = new KuromojiAnalyzer();
// Convert the Japanese text to Romaji
let captionedText;
kuroshiro.init(analyzer)
.then(function(){
captionedText = kuroshiro.convert(text, { to: "romaji" });
})
.then(function(captionedText){
console.log(captionedText);
})
and it fails with the error above
Any hint or help would be immensely appreciated! :)
I know everyone's getting
Kuroshiro is not a constructor
and resolves the problem with adding a defaultBut i don't see anyone getting this weird error as mine:
My code is:
and it fails with the error above Any hint or help would be immensely appreciated! :)