After merging #8893 the rust-ffi is used by both ydocs server and gui2. These two projects are run in different environment - ydocs server is run in node, by electron's client, the second is loaded in electron browser. This makes some problems:
The WASM is compiled with --target web option, which by design is not suitable for running in node. We still can use it in none, but have to load the file manually. Currently, we have hard-coded path pointing to gui2 assets, what is very bad, because that path may change every time WASM file changes.
Moreover, the WASM is also used in tests and dev runs, where the path will differ.
We should make some reliable way to load and initialize Wasm package in both (all three, if include dev/test) environments.