BUG: Since upgrading to dfx v0.12, running into "Failed to install wasm. The replica returned an HTTP Error: Http Error: status 413 Payload Too Large"

No worries, I figured it out. It’s quite straightforward.

For future readers, the way to do it is to run gzip right after the build step. DFX picks it up automatically. Like this:

dfx build <canister_name>
gzip -f -1 ./target/wasm32-unknown-unknown/release/<canister_name>.wasm