{"record":{"id":"bd379d18db3369cc","repo":"dotnet/runtime","slug":"failed-to-load-icu-data","errorCode":null,"errorMessage":"Failed to load ICU data","messagePattern":"Failed to load ICU data","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/mono/browser/runtime/icu.ts","lineNumber":9,"sourceCode":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\nimport cwraps from \"./cwraps\";\nimport { VoidPtr } from \"./types/emscripten\";\n\nexport function wasm_load_icu_data (offset: VoidPtr) {\n    if (!cwraps.wasm_load_icu_data(offset)) {\n        throw new Error(\"Failed to load ICU data\");\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":12,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/mono/browser/runtime/icu.ts#L1-L12","documentation":"Thrown by wasm_load_icu_data when the underlying native call cwraps.wasm_load_icu_data(offset) returns a falsy value. It means the .NET WASM runtime failed to parse or install the provided ICU globalization data blob at the given memory offset.","triggerScenarios":"Produced during globalization initialization when the runtime hands an ICU .dat blob to the native loader and the native side rejects it (returns 0/null). Happens with a corrupt, truncated, version-mismatched, or wrong-architecture ICU .dat file.","commonSituations":"Shipping an ICU .dat built for a different endian/arch or a different .NET version; partial download of the ICU asset (network truncation, wrong hash); mixing invariant mode config with an ICU asset; mismatch between the runtime version and the ICU data file.","solutions":["Use the ICU .dat file that ships with the exact .NET runtime version you are referencing (regenerate/republish assets).","Verify the ICU asset downloaded fully and matches its expected hash (check network/CORS and the asset config hash).","If you do not need globalization, configure invariant/globalization mode correctly so the runtime does not attempt to load ICU data.","Rebuild/publish the app to regenerate the correct blazor.boot.json / asset manifest with matching ICU data."],"exampleFix":"// before: pointing config at a stale/mismatched icudt.dat\n// dotnet.withConfig({ resources: { icu: [{ behavior:'icu', name:'icudt.dat', hash:'oldhash' }] } })\n\n// after: republish so the asset manifest references the matching ICU file\n// dotnet publish regenerates blazor.boot.json with the correct hash\n// or set invariant mode if globalization is not needed:\n// <InvariantGlobalization>true</InvariantGlobalization>","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await createDotnetRuntime(opts);\n} catch (e) {\n  if (/ICU/i.test(String(e))) {\n    // republish/restore the matching icudt.dat or enable invariant mode\n  }\n  throw e;\n}","preventionTips":["Keep the ICU .dat asset version-matched to the runtime.","Verify asset hashes at publish time so corrupt/truncated downloads are caught.","Use invariant globalization mode if you do not need culture-aware formatting."],"tags":["globalization","icu","native","startup"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}