segment-any-text / wtpsplit

Toolkit to segment text into sentences or other semantic units in a robust, efficient and adaptable way.
MIT License
667 stars 39 forks source link

Missing file in NPM package? #27

Closed bard closed 3 years ago

bard commented 3 years ago

I'm trying to import nnsplit in a JavaScript project, and webpack is failing with:

./node_modules/nnsplit/nnsplit.bundle/nnsplit_javascript_bg.wasm
Module not found: Can't resolve './nnsplit_javascript_bg.js' in '/tmp/experiment/node_modules/nnsplit/nnsplit.bundle'

Looking in node_modules/nnsplit/nnsplit.bundle, indeed the file nnsplit_javascript_bg.js is referenced by package.json, but missing from the filesystem.

(Not sure though whether that's the real culprit, as the nodejs example seems to work as intended.)

bminixhofer commented 3 years ago

This seems to be a valid issue. As you said I think ./nnsplit_javascript_bg.js is missing. The Node.js build is built differently so it is not affected. Not sure why it is not included, I'll look into this.

bminixhofer commented 3 years ago

This was https://github.com/rustwasm/wasm-pack/issues/881 (fixed by https://github.com/rustwasm/wasm-pack/pull/839). I'm using a dev version of wasm-pack in CI now, that should fix the issue.

bminixhofer commented 3 years ago

nnsplit_javascript_bg.js is included as of v0.5.5. Thanks for reporting this!