{"record":{"id":"40dabec704ec79bb","repo":"dotnet/aspnetcore","slug":"this-browser-does-not-support-webassembly","errorCode":null,"errorMessage":"This browser does not support WebAssembly.","messagePattern":"This browser does not support WebAssembly\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts","lineNumber":124,"sourceCode":"    assertHeapIsNotLocked();\n    currentHeapLock = MonoHeapLock.create();\n    return currentHeapLock;\n  },\n\n  invokeWhenHeapUnlocked: function invokeWhenHeapUnlocked(callback) {\n    // This is somewhat like a sync context. If we're not locked, just pass through the call directly.\n    if (!currentHeapLock) {\n      callback();\n    } else {\n      currentHeapLock.enqueuePostReleaseAction(callback);\n    }\n  },\n};\n\nasync function importDotnetJs(startOptions: Partial<WebAssemblyStartOptions>): Promise<ModuleAPI> {\n  const browserSupportsNativeWebAssembly = typeof WebAssembly !== 'undefined' && WebAssembly.validate;\n  if (!browserSupportsNativeWebAssembly) {\n    throw new Error('This browser does not support WebAssembly.');\n  }\n\n\n  // Allow overriding the URI from which the dotnet.*.js file is loaded\n  if (startOptions.loadBootResource) {\n    const resourceType: WebAssemblyBootResourceType = 'dotnetjs';\n    const customSrc = startOptions.loadBootResource(resourceType, 'dotnet.js', '_framework/dotnet.js', '', 'js-module-dotnet');\n    if (typeof (customSrc) === 'string') {\n      const absoluteSrc = (new URL(customSrc, document.baseURI)).toString();\n      return await import(/* webpackIgnore: true */ absoluteSrc);\n    } else if (customSrc) {\n      // Since we must load this via a import, it's only valid to supply a URI (and not a Request, say)\n      throw new Error(`For a ${resourceType} resource, custom loaders must supply a URI string.`);\n    }\n  }\n\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore: This dynamic import is handled at runtime and does not need a type declaration.","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts#L106-L142","documentation":"Thrown by importDotnetJs during Blazor WebAssembly boot when typeof WebAssembly === 'undefined' or WebAssembly.validate is missing. The .NET WebAssembly runtime fundamentally requires native WebAssembly support, so boot aborts immediately.","triggerScenarios":"Loading a Blazor WebAssembly app in a browser/WebView that lacks WebAssembly (very old browsers, some locked-down embedded WebViews, or WebAssembly disabled by policy).","commonSituations":"Old browser versions (pre-2017 engines), enterprise WebView controls with WebAssembly disabled, content-security-policy or enterprise policy stripping WebAssembly, testing in a headless/legacy environment without WASM.","solutions":["Require a modern browser (Chrome, Edge, Firefox, Safari) with WebAssembly support.","Update the host WebView/SDK (e.g. WebView2) to a version with WebAssembly enabled.","Show a user-facing fallback page when WebAssembly is unavailable instead of letting boot crash.","If WebAssembly is blocked by enterprise policy/CSP, allow 'wasm-unsafe-eval' / enable WebAssembly in policy."],"exampleFix":"// index.html — guard before Blazor boot\nif (typeof WebAssembly === 'undefined') {\n  document.body.innerHTML = '<p>This app requires WebAssembly. Please update your browser.</p>';\n} else {\n  import('./_framework/blazor.webassembly.js');\n}","handlingStrategy":"validation","validationCode":"// Detect before booting Blazor WASM.\nfunction wasmSupported(): boolean {\n  return typeof WebAssembly !== 'undefined' && typeof WebAssembly.validate === 'function';\n}\nif (!wasmSupported()) { showUnsupportedPage(); } else { import('./_framework/blazor.webassembly.js'); }","typeGuard":"function supportsWebAssembly(): boolean {\n  return typeof WebAssembly !== 'undefined'\n    && typeof WebAssembly.validate === 'function';\n}","tryCatchPattern":null,"preventionTips":["Feature-detect WebAssembly before loading blazor.webassembly.js.","Keep host WebView/SDK current.","Provide a graceful fallback message for unsupported browsers."],"tags":["blazor-wasm","webassembly","browser-support","boot"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}