Open brendantwy opened 1 year ago
So apparently changing the current node version from 18.15.0 to 16.19.1 fixed it. No idea how node versions affect the lib.
Found the cause. Node 18 contains a new experimental fetch API. Disabling it with --no-experimental-fetch
flag works as well
If your .bin model file is > 2Gb using the native fasttext wasm functions to load said model will fail. Very unfortunate :(
amazing finding, thank you! I actually had the same error when released the last update few days ago, while the problem of 2GB is well-known due to Wasm 32bit architecture. Wasm 64bit is a work in progress and it should come in 2023. I will investigate a bit more node 18 and WASM and update the README.md
Also having this issue regardless of node version. Also, the model used is very small so should also not be an issue. Seems to complain just when even only importing the module
@sneljo1 do you have the error log from wasm module init?
Downgrading to Node 16/18 in 2024 is not a viable option anymore, and the error is still there with Node 20. Is there a change that a proper solution is found for this issue?
Downgrading to Node 16/18 in 2024 is not a viable option anymore, and the error is still there with Node 20.
Is there a change that a proper solution is found for this issue?
agreed, it should work on node ETS. I will investigate a bit more. There were some underlying changes in the WASM ABI and wasm modules support since Node 18 that requires some work.
After commenting out
FastTextWasm = require('./wasm/fasttext')
everything seems to work fine, since wasm is not needed in my case, maybe it should be initialized only when needed.
Heya, I am currently facing this error when calling FastText.loadWASM():
Below is my code snippet, following the example given in this issue:
There is no issues with my model directory and I tried running the snippet via the npm install package and git clone installation method.