hexenq / kuroshiro

Japanese language library for converting Japanese sentence to Hiragana, Katakana or Romaji with furigana and okurigana modes supported.
https://kuroshiro.org
MIT License
781 stars 88 forks source link

Error when using demo code #88

Open eric999j opened 2 years ago

eric999j commented 2 years ago

FireShot Capture 518 - RunKit + npm_ kuroshiro - npm runkit com

TypeError: Kuroshiro is not a constructor

halfsprit commented 2 years ago

becase the demo code is not correct, it shoulde be let Kuroshiro = require('kuroshiro').default;

yuuz233 commented 1 year ago

It works under v1.1.2, but not latest, just like described in issues #66. Just find package.json and under dependencies put `"kuroshiro": "~1.1.2", this will let your package manager rollback the version from latest to 1.1.2 where it still works.

Anatoly03 commented 9 months ago

becase the demo code is not correct, it shoulde be let Kuroshiro = require('kuroshiro').default;

Is there a solution for ES6?

Anatoly03 commented 9 months ago

@yuuz233's solution works, thank you