{
  "id": "dotnet/blazor-wasm-prerendering-chunk-load-failure",
  "signature": "Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer: Error: Failed to load module. The required module 'dotnet.wasm' could not be loaded.",
  "signature_zh": "Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer: 错误：无法加载模块。无法加载所需模块 'dotnet.wasm'。",
  "regex": "Error: Failed to load module\\. The required module 'dotnet\\.wasm' could not be loaded\\.",
  "domain": "dotnet",
  "category": "runtime_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "当浏览器由于静态文件服务配置错误、缺少 MIME 类型或初始加载期间网络问题而无法获取 'dotnet.wasm' 时，Blazor WebAssembly 预渲染失败。",
  "versions": [
    {
      "version": ".NET 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Microsoft.AspNetCore.Components.WebAssembly 8.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Blazor WebAssembly 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding 'dotnet.wasm' to a custom bundler without proper WebAssembly MIME type mapping causes the browser to refuse the file.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting the 'bin' and 'obj' folders and rebuilding may fix stale files but not underlying configuration issues like MIME types.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling prerendering entirely (e.g., removing 'RenderMode.InteractiveWebAssembly') avoids the symptom but loses SEO and performance benefits.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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.",
      "success_rate": 0.85,
      "how": "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.",
      "condition": "",
      "sources": []
    },
    {
      "action": "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.",
      "success_rate": 0.8,
      "how": "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.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保服务器为 .wasm 文件设置正确的 MIME 类型：在 IIS 中添加 'application/wasm' MIME 类型；在 Kestrel 中自动处理，但通过浏览器 DevTools 网络选项卡验证。同时检查是否在端点路由之前调用了 'app.UseStaticFiles()'。",
    "如果使用 CDN 或反向代理，确保其透传 WebAssembly 文件。在 Apache 中添加重写规则：'AddType application/wasm .wasm'，或在 Nginx 中添加 'application/wasm' MIME 映射。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-8.0#configure-the-server",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}