Browser CSP Error: Refused to compile or instantiate WebAssembly module

Strict `script-src` policy blocks Wasm compilation unless `wasm-unsafe-eval` is listed.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Browser CSP Error Platform: Security
Common Root Causes:
  • Strict `script-src` policy blocks Wasm compilation unless `wasm-unsafe-eval` is listed.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Add `'wasm-unsafe-eval'` (not `unsafe-eval`) to `script-src` only on routes running Wasm.
Safe Diagnostic Command:
Inspect DevTools Console CSP violation report
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Strict `script-src` policy blocks Wasm compilation unless `wasm-unsafe-eval` is listed. Recommended diagnostic: `Inspect DevTools Console CSP violation report`. Remediation: Add `'wasm-unsafe-eval'` (not `unsafe-eval`) to `script-src` only on routes running Wasm.

Worked Examples

  • Run `Inspect DevTools Console CSP violation report` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-csp-wasm-unsafe-eval-blocked · Independently verified: 2026-11-25

Related Resources