# Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer: Error: Failed to load module. The required module 'dotnet.wasm' could not be loaded.

- **ID:** `dotnet/blazor-wasm-prerendering-chunk-load-failure`
- **Domain:** dotnet
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Blazor WebAssembly prerendering fails when the browser cannot fetch 'dotnet.wasm' due to incorrect static file serving, missing MIME types, or network issues during initial load.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| .NET 8.0 | active | — | — |
| Microsoft.AspNetCore.Components.WebAssembly 8.0.0 | active | — | — |
| Blazor WebAssembly 8.0 | active | — | — |

## Workarounds

1. **Ensure the server sets the correct MIME type for .wasm files: in IIS, add 'application/wasm' MIME type; in Kestrel, it's automatic but verify via browser DevTools network tab. Also check that 'app.UseStaticFiles()' is called before endpoint routing.** (85% success)
   ```
   Ensure the server sets the correct MIME type for .wasm files: in IIS, add 'application/wasm' MIME type; in Kestrel, it's automatic but verify via browser DevTools network tab. Also check that 'app.UseStaticFiles()' is called before endpoint routing.
   ```
2. **If using a CDN or reverse proxy, ensure it passes through WebAssembly files. Add a rewrite rule: 'AddType application/wasm .wasm' in Apache or 'application/wasm' MIME map in Nginx.** (80% success)
   ```
   If using a CDN or reverse proxy, ensure it passes through WebAssembly files. Add a rewrite rule: 'AddType application/wasm .wasm' in Apache or 'application/wasm' MIME map in Nginx.
   ```

## Dead Ends

- **** — Adding 'dotnet.wasm' to a custom bundler without proper WebAssembly MIME type mapping causes the browser to refuse the file. (65% fail)
- **** — Deleting the 'bin' and 'obj' folders and rebuilding may fix stale files but not underlying configuration issues like MIME types. (80% fail)
- **** — Disabling prerendering entirely (e.g., removing 'RenderMode.InteractiveWebAssembly') avoids the symptom but loses SEO and performance benefits. (50% fail)
