You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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! :)
The text was updated successfully, but these errors were encountered:
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! :)
The text was updated successfully, but these errors were encountered: