I'm trying to create a NodeJS application with a Wasm database layer. I use Rust, Diesel as a database driver and wasm-pack
as a WebAssembly compiler.
When I try to build my service with wasm-pack
, it fails trying to link the libpq
library. The PQ_LIB_DIR
environment variable is set, and the diesel-cli
works without any issue, but when I try to compile my service it fails with the following error:
error: linking with `rust-lld` failed: exit code: 1
= note: rust-lld: error: unable to find library -llibpq
How can I fix it?
My system:
- OS: Windows 10
- Rust: 1.38.0
- wasm-pack: 0.8.1
- diesel: 1.4.0
- PostgreSQL: 12