dotnet/runtime · critical · Error
Failed to load ICU data
Error message
Failed to load ICU data
What it means
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.
Source
Thrown at src/mono/browser/runtime/icu.ts:9
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
import cwraps from "./cwraps";
import { VoidPtr } from "./types/emscripten";
export function wasm_load_icu_data (offset: VoidPtr) {
if (!cwraps.wasm_load_icu_data(offset)) {
throw new Error("Failed to load ICU data");
}
}
View on GitHub (pinned to 290d5ab72c)
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.
Example fix
// before: pointing config at a stale/mismatched icudt.dat
// dotnet.withConfig({ resources: { icu: [{ behavior:'icu', name:'icudt.dat', hash:'oldhash' }] } })
// after: republish so the asset manifest references the matching ICU file
// dotnet publish regenerates blazor.boot.json with the correct hash
// or set invariant mode if globalization is not needed:
// <InvariantGlobalization>true</InvariantGlobalization> Defensive patterns
Strategy: validation
Try / catch
try {
await createDotnetRuntime(opts);
} catch (e) {
if (/ICU/i.test(String(e))) {
// republish/restore the matching icudt.dat or enable invariant mode
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- invariant globalization mode is inactive and no ICU data arc
- Locale or culture name is null or empty. localeName=${locale
- Locale info for locale=${localeName} is null or empty.
- Locale info for locale=${localeName} exceeds length of ${dst
- Failed to initialize ICU data
AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06).
Data as JSON: /api/errors/bd379d18db3369cc.
Report an issue: GitHub.