nodejs/node · error

%s: --icu4xMode requires --ucadata\n

Error message

%s: --icu4xMode requires --ucadata\n

What it means

genrb's --icu4xMode produces output tailored for ICU4X consumption and depends on a precompiled uca data file (--ucadata). Using --icu4xMode without --ucadata is unsupported, so genrb records the violation via illegalArg and exits non-zero after printing usage.

Source

Thrown at deps/icu-small/source/tools/genrb/genrb.cpp:161

    U_MAIN_INIT_ARGS(argc, argv);

    options[JAVA_PACKAGE].value = "com.ibm.icu.impl.data";
    options[BUNDLE_NAME].value = "LocaleElements";
    argc = u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);

    /* error handling, printing usage message */
    if(argc<0) {
        fprintf(stderr, "%s: error in command line argument \"%s\"\n", argv[0], argv[-argc]);
        illegalArg = true;
    } else if(argc<2) {
        illegalArg = true;
    }
    if(options[WRITE_POOL_BUNDLE].doesOccur && options[USE_POOL_BUNDLE].doesOccur) {
        fprintf(stderr, "%s: cannot combine --writePoolBundle and --usePoolBundle\n", argv[0]);
        illegalArg = true;
    }
    if (options[ICU4X_MODE].doesOccur && !options[UCADATA].doesOccur) {
        fprintf(stderr, "%s: --icu4xMode requires --ucadata\n", argv[0]);
        illegalArg = true;
    }
    if(options[FORMAT_VERSION].doesOccur) {
        const char *s = options[FORMAT_VERSION].value;
        if(uprv_strlen(s) != 1 || (s[0] < '1' || '3' < s[0])) {
            fprintf(stderr, "%s: unsupported --formatVersion %s\n", argv[0], s);
            illegalArg = true;
        } else if(s[0] == '1' &&
                  (options[WRITE_POOL_BUNDLE].doesOccur || options[USE_POOL_BUNDLE].doesOccur)
        ) {
            fprintf(stderr, "%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\n", argv[0]);
            illegalArg = true;
        } else {
            setFormatVersion(s[0] - '0');
        }
    }

    if((options[JAVA_PACKAGE].doesOccur || options[BUNDLE_NAME].doesOccur) &&

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Always pass --ucadata <file> alongside --icu4xMode, pointing at the compiled collation/uca data file.
  2. If you did not intend ICU4X output, remove --icu4xMode.
  3. Wire your build so that enabling ICU4X mode also supplies the ucadata path (e.g. a single make variable that sets both).

Example fix

# before
genrb --icu4xMode en.txt

# after
genrb --icu4xMode --ucadata uca.icu en.txt
Defensive patterns

Strategy: validation

Validate before calling

// require --ucadata whenever --icu4xMode is set
if '--icu4xMode' in argv and '--ucadata' not in argv:
    raise SystemExit('genrb: --icu4xMode requires --ucadata <file>')

Prevention

When it happens

Trigger: options[ICU4X_MODE].doesOccur is true while options[UCADATA].doesOccur is false on the same genrb command.

Common situations: Adopting ICU4X-compatible data generation but forgetting the uca data input; copying a partial flag set from migration docs; a build target that toggles --icu4xMode via a variable without also setting --ucadata.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/58944ef7aa2ff8a2. Report an issue: GitHub.