Closed jsyszh closed 4 years ago
It looks like mongodb
cannot be run in WASM. I had similar errors when I accidentally tried to compile Hyper to WASM (https://github.com/deprecrated/net2-rs/issues/75#issuecomment-485908436 and https://github.com/deprecrated/net2-rs/issues/75#issuecomment-526039705). Also there is a similar error - https://github.com/rustwasm/wasm-pack/issues/749.
So I'm not sure if it's Seed's bug.
cargo make watch
basically just invokes wasm-pack
for compilation to WASM. I recommend to ask mongodb
guys if it's doable - I didn't find any useful information.
@jsyszh Why do you want to communicate with Mongo directly? I'm not familiar with Mongo too much, but I thought it was always hidden behind classic Rest/GraphQL API.
@MartinKavik Thank you for answering me. I thought I didn't understand wasm. MongoDB can not compilation to WASM directly, just like any other database such as MySQL, Redis. I need to set up a server to communicate with MongDB or other database.
MongoDB can not compilation to WASM directly, just like any other database such as MySQL, Redis.
mongodb
that you included in dependencies
is only a driver/client - it's not standard usage but it should be possible to use it also from the front-end app (in the future / with hacks).@jsyszh Write on Seed forum if you want to recommend an architecture with Seed for your app or have some other questions.
When I add mongodb to the dependencies, like this, [dependencies] mongodb = "0.9.0" and then run
cargo make watch
in the terminal, then, so many errors occurs, like this,......