79576144

Date: 2025-04-15 22:54:49
Score: 1.5
Natty:
Report link

Like @cafce25 said RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve in the CLI works.

But, if you're tired of doing it the whole time and just want to use trunk serve (and also make it easier for other people working on your project), I'd recommend to add a cargo config.

Create a .cargo directory with config.toml inside with:

[target.wasm32-unknown-unknown]
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @cafce25
  • Low reputation (1):
Posted by: Shader